Gift

No attempts yetTime limit1sMemory limit128 MB

Problem

Before leaving for the army, Siheum wants to give a present to each of the $N$ friends who spent time with him. He has $B$ won.

Friend $i$ wants a present that costs $P_i$ won, and shipping costs $S_i$ won. So sending a present to friend $i$ requires $P_i + S_i$ won.

Siheum has exactly one coupon that halves the price of a present. If he uses it on friend $i$, then only $\lfloor P_i / 2 \rfloor + S_i$ won is needed to send that friend's present. (The coupon applies only to the present's price, not to the shipping fee.)

Find the maximum number of friends to whom Siheum can send a present.

Input

The first line contains the number of friends $N$ and the amount of money $B$, separated by a space. ($1 \le N \le 1000$, $1 \le B \le 1{,}000{,}000{,}000$)

Each of the next $N$ lines contains the price $P_i$ of the present that friend $i$ wants and the shipping fee $S_i$, separated by a space. ($0 \le P_i, S_i \le 1{,}000{,}000{,}000$)

Output

On the first line, print the maximum number of friends to whom Siheum can send a present.

Hint

For example, suppose there are $5$ friends and $B = 24$ won, with each friend's $(P_i, S_i)$ equal to $(4, 2), (2, 0), (8, 1), (6, 3), (12, 5)$. If friends 1, 2, and 4 are bought at full price and the coupon is used on friend 3, the total cost is $(4+2) + (2+0) + (\lfloor 8/2 \rfloor + 1) + (6+3) = 6 + 2 + 5 + 9 = 22$ won. This is within the $24$ won budget, so all four presents can be sent and the answer is $4$. Using the coupon on friend 1 or friend 4 gives the same result.