#include <ctime>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#define inf 100010
#define INF 0x7fffffff
#define ll long long

template <class I>
inline void read(I &num){
    num = 0; char c = getchar(), up = c;
    while(!isdigit(c)) up = c, c = getchar();
    while(isdigit(c)) num = (num << 1) + (num << 3) + (c ^ '0'), c = getchar();
    up == '-' ? num = -num : 0; return;
}
template <class I>
inline void read(I &a, I &b) {read(a); read(b);}
template <class I>
inline void read(I &a, I &b, I &c) {read(a); read(b); read(c);}

int n, x;

signed main(){
    read(n, x);
    double cnt = 0;
    for(int i = 1; i <= n; i++) {
        int a, b; read(a, b);
        cnt += a * (b / 100.0);
        if(cnt - x > 1e-8) {
            printf("%d\n", i);
            return 0;
        }
    }
    puts("-1");
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n, x;
  cin>>n>>x;
  x *= 100;
  
  int res = 0;
  int count = 1;
  int ans = -1;
  bool ok = false;
  while(n--){
    int a, b;
    cin>>a>>b;
    res += a * b;
    if(res > x and !ok)ok = true, ans = count;
    count++;
  }
  cout<<ans<<endl;
}
