On a dark and stormy night, Dr. Zomboss dispatched a vanguard of $$$n$$$ Dancing Zombies to breach Dave's defenses. When the upbeat music begins, the Dancing Zombies will appear one by one on the number line in a predetermined rhythm and start spreading out in all directions.
The specific rules are as follows:
The goal of Dr. Zomboss is to cover the entire battlefield with Dancing Zombies. What is the minimum number of seconds required to ensure that every integer coordinate in the interval $$$[0,k]$$$ on the number line contains at least one Dancing Zombie?
The first line contains two integers $$$n,k$$$ ($$$1 \le n \le 10^5$$$, $$$0 \le k \le 10^{12}$$$), representing the total number of Dancing Zombies and the right endpoint of the area to be covered, respectively.
The next $$$n$$$ lines each contain two integers $$$a_i,b_i$$$ ($$$0 \le a_i,b_i \le k$$$), representing the time and initial position of the $$$i$$$th Dancing Zombie, respectively.
Output a single integer on a single line, representing the time required for Dancing Zombies to cover all integer coordinates in the interval $$$[0,k]$$$ on the number line.
3 50 00 51 2
2
2 1020 1026 66
72
For the first example, at the end of each second, the number of Dancing Zombies in the interval $$$[0,5]$$$ on the number line is as follows:
At second $$$2$$$, there is at least one Dancing Zombie at every integer coordinate in the interval $$$[0,5]$$$ on the number line.
| Name |
|---|


