#C8398. Tournament Matches Calculation
Tournament Matches Calculation
Tournament Matches Calculation
In a tournament, each participant plays against every other participant exactly once. For a round with N participants, the total number of matches is calculated using the formula:
\(\frac{N(N-1)}{2}\)
You are given T rounds. For each round, you will receive the number of participants. Your task is to compute and output the total number of matches for each round.
inputFormat
The input is given in two lines:
- The first line contains an integer T representing the number of rounds.
- The second line contains T integers separated by spaces. The i-th integer indicates the number of participants in the i-th round.
outputFormat
Output a single line with T integers separated by a space. Each integer represents the total number of matches in the corresponding round computed by the formula \(\frac{N(N-1)}{2}\).
## sample3
5 8 3
10 28 3