You are going from City A to City B. The distance between A and B is S km. In the most days, you can go at most X km one day. But there are N exceptions, in the Ti th day, you can go at most Yi km. You need to find out the minimum number of days required to reach city B from city A.
First line contains three integers, S,X,N(1≤S,X≤109,0≤N≤103).
The (i+1) th line contains two integers Ti,Yi(1≤Ti,Yi≤109).
It's guaranteed any two Ti are different. Note that Ti is not sorted.
One integer represents the answer.
In the first day, you walked 5km.
In the second day, you walked 4km.
In the third day, you walked 5km.
In the fourth day, you walked 7km and arrived.