Gahui and Sousenkyo 1
Time limit1sMemory limit512 MB
Given the votes of ranks 16 to 20, count the characters outside the top 16 whose votes are within 1,000 of the 16th-place total.
- Level
Easy2 of 10
- Topics
- Implementation, Array
- Solved
- No attempts yet
Problem
Gahui is watching the annual character election. After the election, the top 16 characters, who make up the Tier 1 section (ranks 1 to 16), receive large benefits for one year. Fans therefore vote passionately to push their favorite characters into the top 16. Remarkably, at least one Cinderella appears in every election and achieves an outstanding result.
The competition rate of the election is the number of characters that satisfy both conditions below:
- The character does not belong to the Tier 1 section.
- The difference in votes between the character and the 16th-ranked character is or less.
Find the competition rate of the election.
Input
The votes of the characters ranked 16th through 20th are given on one line, separated by spaces.
Output
Print the answer.
Constraints
- The difference in votes between the 16th-ranked and 20th-ranked characters is or more.
- No two characters received the same number of votes.