Win Streak

면접 대비

시간 제한1초메모리 제한2048 MB

요약
N경기의 점수가 순서대로 주어질 때, 우리 팀이 상대보다 많은 점수를 낸 연속 경기의 최장 길이를 구한다.
난이도

쉬움10점 중 2점

유형
배열, 시뮬레이션, 구현
정답자
아직 제출이 없습니다

문제

The Colorado School of Mines football team is just off of another great season which saw them reach the Division II finals for the second year in a row.

Unfortunately, the team lost the finals, but the Orediggers still had a great season, going on the longest winning streak in school history with fourteen games across the regular season and the playofffs until the final game. (A winning streak is a sequence of chronologically consecutive games where a team scores more points than their opponent.)

Orediggers head coach Pete Sterbick has tasked you with analyzing the games of the other teams in the Rocky Mountain Athletic Conference (RMAC) to determine how long their longest winning streaks were.

Given the scores for all of the games that one particular team has played, Coach Sterbick wants to know the length of the longest winning streak for that team.

입력

The first line of input will be a single integer 1≤N≤1041 \leq N \leq 10^4, the number of games the team you are analyzing has played.

The next NN lines will each contain two integers 0≤S,T≤2220 \leq S, T \leq 222, representing the score of the team you are analyzing, and the score of the opposing team, respectively. The scores are given in chronological order.

출력

Output a single integer, the length of the longest sequence of consecutive games where the team you are analyzing scored more points than their opponent.

예제1

  1. 예제 1

    입력
    10
    14 7
    17 20
    20 10
    28 14
    30 7
    10 17
    45 20
    24 10
    28 24
    14 14
    
    예상 출력
    3