Canadian Computing Competition: 2022 Stage 1, Junior #2
Fergusonball players are given a star rating based on the number of points that they score and the number of fouls that they commit. Specifically, they are awarded stars for each point scored, and stars are taken away for each foul committed. For every player, the number of points that they score is greater than the number of fouls that they commit.
Your job is to determine how many players on a team have a star rating greater than . You also need to determine if the team is considered a gold team, which means that all the players have a star rating greater than .
The first line of input consists of a positive integer representing 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 that the player scored. The second line in a pair is the number of fouls that the player committed. Both the number of points and the number of fouls are non-negative integers.
Output the number of players that have a star rating greater than , immediately followed by a plus sign if the team is considered a gold team.
The star rating for the first player is , for the second player it is , and for the third player it is . All three players have a rating greater than , so the team is considered a gold team.
The star rating for the first player is , which is not greater than , and for the second player it is . Since only one of the two players has a rating greater than , this team is not considered a gold team.

No comments yet. Be the first to comment!