Butterball is on a diet, so until autumn, his diet will consist only of broccoli, rice, and chicken breast. Butterball can eat any amount of broccoli, but there are restrictions on rice and chicken breast.
Until autumn, Butterball will have exactly $$$n$$$ trips to the store, and for each trip, he knows in advance the amount of dry rice in grams $$$a_i$$$ and the amount of raw chicken breast in grams $$$b_i$$$ that he is going to buy. It is also known that one meal of Butterball will consist of $$$k$$$ grams of rice and chicken breast combined. But Butterball decided not to mix rice and chicken breast from different trips to the store, so a meal will always have one of the following types:
For example, if Butterball has two trips to the store, on the first trip he buys 200 grams of rice and 500 grams of chicken breast, and on the second trip he buys 100 grams of rice and 200 grams of chicken breast, then he will be able to prepare only 2 meals with $$$k = 400$$$. Like this, for instance:
Help Butterball determine the maximum number of meals he can prepare for himself until autumn!
The first line contains two integers $$$n$$$ and $$$k$$$ ($$$1 \leq n, k \leq 500$$$): the number of trips to the store and the total weight of food in grams for one meal, respectively.
In the $$$i$$$-th of the following $$$n$$$ lines, two integers $$$a_i$$$ and $$$b_i$$$ ($$$0 \leq a_i, b_i \leq 10^9$$$) are given: the amount of grams of rice and chicken breast bought on the $$$i$$$-th trip to the store, respectively.
Output a single integer: the maximum number of meals that Butterball can prepare.
2 400200 500100 200
2
1 350100 250
1
2 500100 200300 100
0
The first example is described above.
In the second example: Butterball can prepare exactly one meal using all the products from the first (and only) trip to the store.
In the third example: Butterball will not be able to prepare any meals because, in both trips to the store, the total weight of rice and chicken breast is less than needed for one meal. Additionally, the total weight of rice from two trips is less than needed for one meal. The same statement is true for chicken breast.