Hiring

No attempts yetTime limit1sMemory limit128 MB

Problem

Jaehyun is hiring workers to build a skyscraper called the "Second Apple Tower". There are $N$ applicants numbered from $1$ to $N$. Worker $i$ has a minimum wage $S_i$ and a construction-certificate level $Q_i$, so hiring worker $i$ requires paying them a wage of at least $S_i$.

To promote construction certificates, the government made a rule that every hired worker's wage must be directly proportional to their certificate level. That is, once a single real coefficient $k$ is chosen, each hired worker $i$ is paid exactly $Q_i \times k$. Wages may be real numbers, not just integers. Because every hired worker must satisfy $Q_i \times k \ge S_i$, the coefficient $k$ must be chosen large enough to meet the minimum-wage requirement of all hired workers.

Jaehyun has $W$ dollars. He does not care about certificate levels and only wants to finish the building as fast as possible, so he wants to hire as many workers as possible while keeping the total wage he pays at most $W$. Find the maximum number of workers he can hire.

Input

The following data is given on standard input.

  • The first line contains the number of workers $N$ and the amount of money $W$, separated by a space.
  • Each of the next $N$ lines contains the minimum wage $S_i$ and the certificate level $Q_i$ of worker $i$, separated by a space (the $i$-th such line describes worker $i$).

Output

Print a single integer: the maximum number of workers that can be hired within the budget.

Constraints

  • $1 \le N \le 500{,}000$ (number of applicants)
  • $1 \le S_i \le 20{,}000$ (minimum wage of worker $i$)
  • $1 \le Q_i \le 20{,}000$ (certificate level of worker $i$)
  • $1 \le W \le 10{,}000{,}000{,}000$ (amount of money available)
  • All numbers given in the input are integers.