#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  vector<int> V;
  vector<int> P;
  long X;
  long drink = 0;
  int ans;
  cin >> N >> X;
  int a, b;
  for(int i = 0; i < N; ++i){
    cin >> a >> b;
    V.push_back(a);
    P.push_back(b);
  }
  for(ans = 0; ans < N; ++ans){
    drink += V.at(ans) * P.at(ans);
    if(drink > X * 100){
      cout << ans + 1 << endl;
      return 0;
    }      
  }
  
      cout << -1 << endl;
 }

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<n;++i)
#define rep1(i, n) for(int i=1;i<=n;++i)
#define ll long long
int main(){
    int n;
    ll x, v, p;
    cin>>n>>x;
    x *= 100;
    vector<ll>a;
    rep(i, n){
        cin>>v>>p;
        a.emplace_back(v * p);
    }

    int ans = -1;
    ll sum = 0;

    rep(i, n){
        sum += a[i];
        if(sum > x){
            ans = i+1;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}