#P188. 【例31.3】正常血压
【例31.3】正常血压
Description
In the intensive care unit, a patient's blood pressure is measured every hour. The blood pressure is considered normal if the systolic pressure is between and (inclusive) and the diastolic pressure is between and (inclusive). Given the blood pressure measurements of a patient over several hours, calculate the longest duration of consecutive hours during which the patient's blood pressure remained normal.
Input Format
The first line contains an integer ().
The next lines each contain two positive integers, representing the systolic and diastolic pressures of a measurement (both within the range []), separated by a space.
Output Format
Output a single line containing the longest duration of consecutive hours during which the blood pressure remained normal.
Sample
4
100 80
90 50
120 60
140 902