#C4504. Longest Descending Segment of a Hike

    ID: 48050 Type: Default 1000ms 256MiB

Longest Descending Segment of a Hike

Longest Descending Segment of a Hike

Alice recorded several points during her hike, where each point is represented by two integers: an x-coordinate and an altitude value. Your task is to compute the length of the longest continuous segment during which the altitude strictly decreases from one point to the next.

Formally, given n points \((x_i, y_i)\) for \(i = 1, 2, \dots, n\), find the maximum number of consecutive indices \(i\) (starting from 2) such that \(y_i < y_{i-1}\). If no descending segment exists, output 0.

inputFormat

The first line contains an integer n, the number of points recorded during the hike.

Each of the following n lines contains two space-separated integers representing the x-coordinate and the altitude of a point.

outputFormat

Output a single integer, which is the length of the longest descending segment of the hike.

## sample
6
1 10
2 9
3 8
4 7
5 6
6 5
5

</p>