#include <algorithm>
#include <cassert>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#pragma warning(disable:4996)
long long dp[10005];
int main() {
int n, m;
double _m;
while(1) {
cin >> n >> _m;
if(!n) break;
m = (int)(_m * 100 + 1e-9);
memset(dp, 0, sizeof(dp));
for(int i = 0; i < n; ++ i) {
int c; double _p; int p;
cin >> c >> _p;
p = (int)(_p * 100 + 1e-9);
for(int j = p; j <= m; ++ j) {
dp[j] = max(dp[j], dp[j - p] + c);
}
}
cout << *max_element(dp, dp + m + 1) << endl;
}
return 0;
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNhc3NlcnQ+CiNpbmNsdWRlIDxzc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxjc3RkaW8+CiNpbmNsdWRlIDxjc3RyaW5nPgojaW5jbHVkZSA8aW9zdHJlYW0+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDx2ZWN0b3I+CiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI3ByYWdtYSB3YXJuaW5nKGRpc2FibGU6NDk5NikKIApsb25nIGxvbmcgZHBbMTAwMDVdOwogCmludCBtYWluKCkgewogICAgaW50IG4sIG07CiAKICAgIGRvdWJsZSBfbTsKICAgIHdoaWxlKDEpIHsKICAgICAgICBjaW4gPj4gbiA+PiBfbTsKICAgICAgICBpZighbikgYnJlYWs7CiAgICAgICAgbSA9IChpbnQpKF9tICogMTAwICsgMWUtOSk7CiAKICAgICAgICBtZW1zZXQoZHAsIDAsIHNpemVvZihkcCkpOwogCiAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IG47ICsrIGkpIHsKICAgICAgICAgICAgaW50IGM7IGRvdWJsZSBfcDsgaW50IHA7CiAgICAgICAgICAgIGNpbiA+PiBjID4+IF9wOwogICAgICAgICAgICBwID0gKGludCkoX3AgKiAxMDAgKyAxZS05KTsKIAogICAgICAgICAgICBmb3IoaW50IGogPSBwOyBqIDw9IG07ICsrIGopIHsKICAgICAgICAgICAgICAgIGRwW2pdID0gbWF4KGRwW2pdLCBkcFtqIC0gcF0gKyBjKTsKICAgICAgICAgICAgfQogICAgICAgIH0KIAogICAgICAgIGNvdXQgPDwgKm1heF9lbGVtZW50KGRwLCBkcCArIG0gKyAxKSA8PCBlbmRsOwogICAgfQogCiAgICByZXR1cm4gMDsKfQ==