5517: 暑期营第一天 万人狂欢节(arrival)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:6 Solved:6

Description

Input


Output

Sample Input Copy

6 4
10 3
6 2
5 3
9 7
3 6
11 2

Sample Output Copy

2

HINT

对于100%数据: 1<=n <= 50,000,1<= pi,ci <= 1,000,000,000,1 <=0 <=1,000,000,000