A runway segment spans from position 0 to position T. There are n floodlights; floodlight i illuminates the closed interval [s, e] with 0 <= s < e <= T. Choose the fewest floodlights whose illuminated intervals together cover every point of [0, T] (coverage must be continuous, with intervals overlapping or touching so no point is left dark). Report the minimum number of floodlights needed, or -1 if it is impossible to cover the whole segment.
Input format
Line 1: two integers n and T.
Next n lines: two integers s and e describing one floodlight (0 ≤ s < e ≤ T).
Output format
A single integer: the minimum number of floodlights, or -1 if full coverage is impossible.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ T ≤ 1000000000
- 0 ≤ s < e ≤ T