Don't pass me the ball!
Time limit2sMemory limit512 MB
Given the scorer's jersey number J, count the ordered increasing 4-tuples of distinct jersey numbers ending at J.
- Level
Easy3 of 10
- Topics
- Combinatorics, Math
- Solved
- No attempts yet
Problem
A soccer league plays under slightly different rules. A goal counts only when both of the following hold: the 4 players who, in order, touched the ball just before the goal have jersey numbers that are strictly increasing, and the player with the highest jersey number among them is the one who scored the goal.
Players wear jersey numbers from to , and each jersey number is worn by exactly one player.
Given the jersey number of the goal scorer, determine how many combinations of players can produce a valid goal.
Input
A single positive integer (), the jersey number of the goal scorer.
Output
Output one line containing the number of possible scoring combinations in which jersey number is the goal scorer.