a912: Fergusonball Ratings
Tags : for if 累加 迴圈 運算
Accepted rate : 18人/21人 ( 86% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-12-17 10:43

Content

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.

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.

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.

Sample Input #1
3
12
4
10
3
9
1
Sample Output #1
3+
Sample Input #2
2
8
0
12
1
Sample Output #2
1
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (20%): 1.0s , <1K
公開 測資點#1 (20%): 1.0s , <1K
公開 測資點#2 (20%): 1.0s , <1K
公開 測資點#3 (20%): 1.0s , <1K
公開 測資點#4 (20%): 1.0s , <1K
Hint :
Tags:
for if 累加 迴圈 運算
出處:
CCC2021Junior [管理者:
issin@g.puic... (冼一心老師)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」