#K2551. Unique Team Formation
Unique Team Formation
Unique Team Formation
In this problem, you are given an integer (k). Your task is to determine the number of distinct ways to form teams of three players such that no two teams have the same total skill level.
The formation rule is as follows: the minimal possible team sum is given by (1+2+3=6) and every additional team increases the sum by 3, forming a sequence: (6, 9, 12, \ldots). Therefore, if it is possible to form teams, the number of teams is exactly (\frac{k}{3}).
Note: If (k) is less than 3 or not a multiple of 3, then forming any valid team is impossible, and you should output 0.
inputFormat
The input consists of a single line containing one integer (k) (with (0 \le k \le 10^9)).
outputFormat
Output a single integer representing the number of ways to form teams of three with distinct total skill levels based on the given (k).## sample
3
1
</p>