시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 (추가 시간 없음) 512 MB 1 1 1 100.000%

문제

Reed Dacht is a freelance book editor who works out of his home. Various publishers send him texts to read along with a deadline date for when they would like his editorial comments to be sent back to them. Reed is very precise with his reading and will never read more than one book at a time, so he never starts a new book until after he is finished reading the previous one. He is willing to change the rate (number of pages per day) at which he reads books, but to be fair to each of his clients he insists on using the same speed for all books.

The other day Reed got a large set of editing requests and has a bit of a problem. He doesn’t think that there’s any way he can read all of the books by the specified deadlines. He could set his reading speed high enough to get them all done in time, but that might compromise the accuracy of his editing (as well as severely tax his eyesight). To avoid that he could select a slower reading speed, but then too many of the editing jobs would go past their deadlines. He has decided on a compromise: he is willing to let a small number of books go past deadline (so as to annoy only a small number of clients) and will set his reading speed to the smallest possible number of pages per day so that no more than that number of books will be late. But what should that reading speed be? That’s where you come in.

입력

Input starts with two integers n m where n (1 ≤ n ≤ 105) is the number of books to edit and m (0 ≤ m < n) is the number of editing jobs that Reed will allow to be late. Following this are n lines each describing one book. Each line contains two integers l d where l (1 ≤ l ≤ 109) is the length (in pages) of the book and d (1 ≤ d ≤ 104) is the deadline for that book (number of days until is it due).

출력

Output the minimum integer speed (pages per day) which allows no more than m late editing jobs.

예제 입력 1

3 1
450 9
500 6
300 4

예제 출력 1

84