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

typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define pii pair <int, int>
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define F first
#define S second

ld eps = 1e-9;

int main(){
	fast_io;
	int n, x;
	cin >> n >> x;
	ld s = 0;
	int ans = -1;
	for(int i = 0; i < n; i ++){
		ld v, p;
		cin >> v >> p;
		s += (v * p) / 100;
		if(ans == -1 && s - x > eps){
			ans = i + 1;
		}
	}
	cout << ans;
	
	return 0;
}

