ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Unsorted > задача:


50952 - Derby Tirana

Гость
• Обсуждение задачи (4)

Задачи раздела

• 50489 - Football Championship
• 51004 - Word Search Game
• 50430 - ATM
• 50426 - Calculating Sales
• 50425 - Calculating Weekly Pay
• 50438 - Pattern with stars
• 50820 - Post Office
• 50810 - Print Office
• 50952 - Derby Tirana
• 50443 - Dajte Express
• 50819 - Linked Numbers
• 50519 - Image Filtering
• 50798 - Passing the course
• 50799 - OSHEE Electric Bill
• 50833 - Min of Odd Positions
• 50821 - Derivative of an array
• 50808 - Total Distance Traveled

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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