#K74357. Counting Valid Checkpoints
Counting Valid Checkpoints
Counting Valid Checkpoints
Problem Description: Given an integer N representing the number of levels in a video game, determine the number of ways to choose 3 distinct checkpoints such that they are in strictly increasing order. This is equivalent to computing the binomial coefficient (\binom{N}{3}), which can be calculated by the formula (\frac{N \times (N-1) \times (N-2)}{6}). Note that if (N < 3), no valid selection exists, so the output should be 0.
inputFormat
Input Format: A single integer N is provided via standard input which denotes the number of levels in the game.
outputFormat
Output Format: Output a single integer representing the number of valid ways to choose 3 checkpoints.## sample
3
1