Олимпиадный тренинг

Задача 39245. Healthy chocolate


Hearing that chocolate is good for the brain and nervous system, student Vasily decides to buy chocolate for the entire academic year. Vasily decided to buy chocolate for R rubles. He walked around in the city all N shops that sell various chocolates. Vasily saved to a file the information that in ith shop he can buy no more Bbars of chocolate by < code>Ai rubles each.
A thrifty student wants to spend as much of his money as possible (preferably all at once) and buy as much chocolate as possible with it. Help Vasily figure out how many chocolate bars he can buy with his own money and how much the most expensive bar he can buy will cost.

Input
The first line in the file contains two numbers: N and R. The following N lines contain a pair of numbers: Ai and Bi.< br />
In your answer, write two numbers separated by a space on one line: first, the number of chocolate bars that Vasily can buy with his own money, then the cost of the most expensive chocolate bar that Vasily will have after the purchase.

Assignment file