#include <bits/stdc++.h>
#define ll long long
#define _ ios::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
using namespace std;
 
int main() { _
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout);
#endif
    ll n, m; cin >> n >> m;
    vector <pair <ll, ll>> vec(n);
    for(int i = 0; i < n; i++){
        cin >> vec[i].first >> vec[i].second;
    }
    long double sum = 0.0;
    for(int i = 0; i < n; i++){
        sum += 1.0 * vec[i].first * vec[i].second / 100;
        if(sum > m){
            cout << i + 1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}