2384: Fergusonball Ratings

Memory Limit:128 MB Time Limit:1.000 S
Creator:
Submit:9 Solved:4

Description

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 5 stars for each point scored, and 3 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 40. 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 40.

费格森球球员根据他们得分的数量和犯规的数量获得星级评分。具体来说,他们每得1分就获得5星,每犯1次规则就扣掉3星。对于每个球员来说,他们得分的数量总是大于他们犯规的数量。你的任务是确定一支球队中有多少球员的星级评分超过40。你还需要确定这支球队是否被认为是金牌队,这意味着所有球员的星级评分都超过40。

Input

The first line of input consists of a positive integer N 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.
输入的第一行包含一个正整数 N,代表球队的球员总数。
接下来是每个球员的一对连续行。
每对中的第一行是球员得分的数量, 每对中的第二行是球员犯规的数量, 得分和犯规的数量都是非负整数。

Output

Output the number of players that have a star rating greater than 40, immediately followed by a plus sign if the team is considered a gold team.
输出星级评分超过40的球员数量,如果这支球队被认为是金牌队,则在数字后面立即加上一个加号.

Sample Input

3
12
4
10
3
9
1

Sample Output

3+

HINT

The image shows the star rating for each player. For example, the star rating for the first player is 12×5−4×3 = 48. All three players have a rating greater than 40 so the team is considered a gold team. 
该图像展示了每位球员的星级评分。例如,第一位球员的星级评分为 12×5−4×3 = 48。所有三名球员的评分都超过40,所以这支球队被认为是金牌队。

Source/Category