The Candy Store

Time limit3sMemory limit512 MB

Problem

Sanggeun and Seonyeong were walking together when they passed a candy store. Sanggeun suddenly began lecturing about how unhealthy candy is, and an annoyed Seonyeong challenged him to a bet over who could ruin their health more. Sanggeun accepted on the spot.

The two of them enter the store with the exact same amount of money and buy candy. Whoever ends up with the greater total number of calories wins the bet.

Pretending to head to the restroom, Sanggeun slipped out, opened his laptop, and connected to the store's system, which lists the price and calorie count of every candy currently on sale. Each kind of candy is effectively unlimited in stock, so you may buy as many of the same kind as you like. Candy cannot be split, so the quantity of each kind must be a non-negative integer.

Given the price and calorie count of every candy in the store, write a program that finds the maximum total calories you can buy with the money you have.

Input

The input consists of several test cases.

The first line of each test case contains the number of candy kinds $n$ in the store and the amount of money $m$ that Sanggeun has. ($1 \le n \le 5,000$, $0.01 \le m \le 100.00$) $m$ is always given to exactly two decimal places.

Each of the next $n$ lines contains a candy's calorie count $c$ and price $p$. ($1 \le c \le 5,000$, $0.01 \le p \le 100.00$) $c$ is always an integer, and $p$ is always given to exactly two decimal places.

The last line of the input is 0 0.00 and must not be processed.

Output

For each test case, print on its own line the maximum total calories that can be bought with the money $m$.