#P2107. 小 Z 的 AK 计划

小 Z 的 AK 计划

Description

In Xiao Z's hometown, there is a street of computer labs, with many labs. Each lab has ten thousand people solving problems. Xiao Z just finished CodeChef and is going for a walk.

There are nn computer labs on the street. The ii-th lab is at coordinate xix_i, and Xiao Z's home is at 00. Xiao Z moves at speed 11, that is, the time from x1x_1 to x2x_2 is x1x2|x_1 - x_2|.

Each lab has a different number of students, and their ACM problem levels vary. After reaching lab ii, Xiao Z can spend tit_i time thinking, and then instantly "AK"; of course, he can also pass by without entering.

Xiao Z now has only mm units of time. After that, he must hurry to Codeforces. He wants to know the maximum number of labs he can "AK". Please help him.

Input Format

The first line contains two integers n,mn, m.

The next nn lines each contain two integers xi,tix_i, t_i.

Output Format

Output one integer: the maximum number of labs Xiao Z can "AK".

2 10
1 100
5 5
1

Hint

For 30%30\% of the testdata, n20n \leq 20.

For 60%60\% of the testdata, n1000n \leq 1000.

For 100%100\% of the testdata, 1n1051 \leq n \leq 10^5, 0m,xi10180 \leq m, x_i \leq 10^{18}, 0ti1090 \leq t_i \leq 10^9.

Translated by ChatGPT 5