#TCTM5805. Fergusonball Ratings

0
    ID: 1980 传统题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>5805循环结构Junior(初级组)CCC 2022简单

Fergusonball Ratings

Fergusonball Ratings

题目描述

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.

现在有一个球队需要你评价。

球队中的第 ii 个人进了 aia_i 个球,犯规了 bib_i 次。

所以第 ii 个人的分数就是 5×ai−3×bi5\times a_i-3\times b_i 。

如果第 ii 个人的分数大于 4040 ,那么这个人就是一个黄金球员。

相对应的,如果这个球队的所有人都是黄金球员,那么这个球队就是一个黄金球队。

输入格式

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.

第一行一个整数 nn ,表示球队的人数。

接下来 2n2n 行,第 2i−12 i - 1 行表示 aia_i,第 2i2 i 行表示 bib_i 。

输出格式

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.

共一行,表示黄金球员的数量。如果这是一个黄金球队,请再输出一个 + 。

3
12
4
10
3
9
1
3+
2
8
0
12
1
1

提示

#### 数据范围与提示 对于全部数据:$1\le n\le 20,1\le a_i,b_i\le2000$ #### 样例解释 Explanation of Output for Sample Input 1 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.

Explanation of Output for Sample Input 2 The image shows the star rating for each player.Since only one of the two players has a rating greater than 40, this team is not considered a gold team.

来源

童程童美