In a certain country, it was decided to start combating the overwhelming amount of advertising on television channels.To this end, a law was passed stipulating that the total amount of advertising time in any given hour should not exceed $$$T$$$ seconds.Write a program that will check for compliance with this law.
The first line of the input contains an integer $$$N$$$ — the number of advertising inserts during the checked period ($$$1 \le N \le 10^5$$$).
The second line contains an integer $$$T$$$ ($$$0 \le T \lt 3600$$$).
Each of the next $$$N$$$ lines contains two integers $$$t_1$$$ and $$$t_2$$$ separated by a space — the start and end times of the next advertising insert ($$$0 \le t_1 \lt t_2 \le 10^9$$$). The times are given in seconds from the start of the check. The times are ordered in ascending order (i.e., in each subsequent line, $$$t_1$$$ is greater than $$$t_2$$$ in the previous line).
If there is such an hour (that is, an interval of time lasting 3600 seconds) in which there was more than $$$T$$$ seconds of advertising, then output a single integer — the start time of such an interval. If there are multiple correct answers, output the smallest non-negative one. If the sought interval does not exist, output -1.
Each test is evaluated independently. The tests are divided into groups corresponding to the following subtasks:
| Subtask | Additional Conditions | Points |
| $$$1$$$ | $$$N \le 100$$$, $$$t_2 \le 10^4$$$ | 30 |
| $$$2$$$ | $$$N \le 10^5$$$, $$$t_2 \le 10^6$$$ | 30 |
| $$$3$$$ | - | 40 |
310000 1005000 53006000 7000
3101
135990 3599
-1
Reminder for those solving in Python: to input two integers separated by a space, you can do it like this:
t1, t2 = map(int, input().split())
| Name |
|---|


