Match Results
Time limit1sMemory limit256 MB
Read N rounds of scores for A and B, and report how many rounds each player won.
- Level
Easy1 of 10
- Topics
- Implementation, Simulation
- Solved
- No attempts yet
Problem
A and B play a game consisting of rounds. In each round, whoever scores more points wins that round. That is, in the -th round, if A's score is greater than B's score, A wins; if B's score is greater than A's score, B wins. If the two scores are equal, the round is a tie and nobody wins.
Given A's and B's scores in each of the rounds, write a program that prints the number of rounds A won and the number of rounds B won.
Input
The first line contains an integer ().
Each of the next lines contains two integers and (), the scores in that round, separated by a space.
Output
On the first line, print the number of rounds A won and the number of rounds B won, in that order, separated by a space.