#K5406. Total Matches in a Tournament
Total Matches in a Tournament
Total Matches in a Tournament
Given an integer ( t ) representing the number of teams in a tournament, calculate the total number of matches to be played if each team plays every other team exactly once. The total number of matches is given by the formula: ( \frac{t(t-1)}{2} ). For example, if there are 4 teams, then the total number of matches is 6.
inputFormat
The input consists of a single integer ( t ) (( 0 \leq t \leq 10^9 )), which represents the number of teams in the tournament. Input is read from standard input (stdin).
outputFormat
Output a single integer representing the total number of matches played in the tournament. The result is printed to standard output (stdout).## sample
0
0