#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

int main() {
  ll n, x;
  cin >> n >> x;
  V<ll> v(n), p(n);
  rep(i, n) cin >> v[i] >> p[i];
  x *= 100;
  ll s = 0;
  rep(i, n) {
    s += v[i] * p[i];
    if (s > x) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}

#include <iostream>

using namespace std;

int main()
{
    int n,x,v,p;
    int cnt = 0;
    bool notdrk = true;
    cin>>n>>x;
    int actx = x*100;
    for(int i = 0; i<n; i++){
        cin>>v>>p;
        cnt += p * v;
        if(cnt > actx and notdrk == true){
            cout<<i+1;
            notdrk = false;
        }
    }
    if(notdrk == true){
        cout<<-1<<endl;
    }
    return 0;
}