Annoyed Coworkers
시간 제한2초메모리 제한1024 MB
각 동료의 초기 짜증이 a이고 도움을 요청할 때마다 d씩 오를 때, h번의 요청을 나눠 가장 짜증난 동료의 최종 짜증을 최소로 만든다.
문제

A picture of you, not working. Source: XKCD 303
It's another day in the office, and you're a mastermind of not doing any work yourself. Instead, you'll go to your coworkers for "help," but secretly have them do all the work.
You've determined that the more one of your coworkers helps you, the more annoyed they become. You've also been able to determine how much more annoyed a coworker gets everytime you ask them for help. At the beginning of the day, a coworker is initially annoyed at you. That's their annoyance level. Everytime you ask them for help though, they become more annoyed at you -- their annoyance level increases by a constant amount so that .
You want to complete a project of tasks solely with "help" from your coworkers, but you need to be careful not to annoy any of them too much.
What's the best you can do?
입력
The first line contains integers and , where () is the number of times you have to ask for help to complete the project, and () denotes the number of coworkers you have.
Each of the following lines contains two positive integers and , representing a coworker whose initial annoyance level is and who is getting more annoyed at you by an increase of every time you ask them for help ().
출력
Output a single number, which is the maximum annoyance level any coworker has at you provided you use an optimal strategy to minimize this level. (In other words, of all possible strategies, choose one that minimizes the annoyance level of the worker or workers who are most annoyed at you at the end.)