Fergusonball Ratings
InterviewTime limit1sMemory limit1024 MB
For each player, compute 5 times points minus 3 times fouls, count how many exceed 40, and mark the team gold if all do.
- Level
Easy2 of 10
- Topics
- Implementation, Math, Brute force
- Solved
- No attempts yet
Problem
Fergusonball players are given a star rating based on the number of points they score and the number of fouls they commit. Specifically, they are awarded 5 stars for each point scored, and 3 stars are taken away for each foul committed. For every player, the number of points scored is greater than the number of fouls committed.
Determine how many players on a team have a star rating greater than 40. Also determine whether the team is a gold team, which means every player has a star rating greater than 40.
Input
The first line of input contains a positive integer N, the total number of players on the team. This is followed by a pair of consecutive lines for each player. The first line in a pair is the number of points the player scored. The second line in a pair is the number of fouls the player committed. Both the number of points and the number of fouls are non-negative integers.
Output
Output the number of players whose star rating is greater than 40, immediately followed by a plus sign if the team is a gold team.