#T791. 正常血压

正常血压

Description

The intensive care unit measures a patient's blood pressure every hour. If the systolic pressure is between 90-140 and the diastolic pressure is between 60-90 (including the endpoints), it is considered normal. Now, given the blood pressure measurements of a patient over several hours, calculate the maximum number of consecutive hours the patient maintained normal blood pressure.

Input Format

The first line is a positive integer n (n < 100), followed by n lines. Each line contains two positive integers representing the systolic and diastolic pressures measured during one hour.

Output Format

Output a single line indicating the maximum number of consecutive hours the blood pressure remained normal.

4
100 80
90 50
120 60
140 90
2

译文

CodesOnline