HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


50952 - Derby Tirana

Guest
• Discussion of problem (4)

Volume problems

• 50896 - Sum of Even Numbers
• 50815 - Breaking the Bunker
• 50899 - How Many Years
• 50806 - TVSH
• 51078 - Max trade
• 50820 - Post Office
• 50807 - Euro to Leke
• 50810 - Print Office
• 50952 - Derby Tirana
• 50871 - Harmonic Mean
• 50859 - Low performance
• 50508 - The Biggest Area
• 51077 - Grades Histogram
• 50528 - Rock-Scissors-Paper
• 50744 - The Smallest Perimeter
• 50808 - Total Distance Traveled
• 50814 - Buying Books from Internet

Feedback

If you notice incorrect translations in Contester, please let author know.

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.



Для отправки решений необходимо выполнить вход.

www.contester.ru