#C3284. Minimum Interactions
Minimum Interactions
Minimum Interactions
In this problem, you are given n computers. All computers need to communicate with each other. Each interaction involves a pair of computers. Your task is to find the minimum number of interactions required for every computer to communicate with every other computer at least once.
The number of interactions can be mathematically determined using the formula:
\(I = \frac{n \times (n-1)}{2}\)
For example, if there are 4 computers, the minimum number of interactions is 6.
inputFormat
The input consists of a single integer n
(1 ≤ n ≤ 10^6) representing the number of computers. The integer is provided via standard input (stdin).
outputFormat
Output a single integer, which is the minimum number of interactions required for all computers to communicate with each other. The answer should be written to the standard output (stdout).
## sample1
0