#T403. 正常血压

正常血压

Description

The intensive care unit measures a patient's blood pressure every hour. If the systolic pressure is between 90-140 (inclusive) and the diastolic pressure is between 60-90 (inclusive), it is considered normal. Given a series of blood pressure measurements for a patient, calculate the maximum number of consecutive hours the patient's blood pressure remained normal.

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 for one measurement.

Output Format

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

4
100 80
90 50
120 60
140 90
2

译文

CodesOnline