Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Question by Ibrahim Mesecan.
Derby Winner
In a page you have the statistics of Tirana derbies
between two teams. In a match,
- if a team scores more goals than the
other team, the winning team gets 3 points
and the losing team gets 0 points.
- If they cannot score any goal or if they
score the same number of goals, each
team gets 1 point.
The team which collects more points is
the winner. If they have the same number
of points the team which scored more
goals is the winner. Otherwise print zero '0'.
Question:
Read the given information for
n matches and define the winner.
Input specification
First you will be given
the number of matches (n) where n is between
0 and 2500. Then, in the following n lines
you will be given two integers.
Output specification
Show 1, if the first team wins.
Show 2, if the second team wins. Show zero '0'
otherwise.
Sample Input
5
0 1
4 2
4 0
2 5
4 5
|
Sample Output
2
|
Explanation:
First team won two matches
(6 points and scored 14 goals), and the
second team won three matches
(9 points and scored 13 goals).
So, the second team wins.
Для отправки решений необходимо выполнить вход.
|