#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
using Graph = vector<vector<int>>;

int main(){
  int n,x;
  cin >> n >> x;
  x *= 100;
  for(int i=1;i<=n;i++){
    int v,p;
    cin >> v >> p;
    x -= v*p;
    //cout << x << endl;;
    if(x<0){
      cout << i;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
#include<bits/stdc++.h>
#define N 1000005 
#define LL long long 
using namespace std;

int n;
LL x;
LL a[N],b[N];

inline int qr()
{
	char a=0;int x=0,w=1;
	while(a<'0'||a>'9'){if(a=='-')w=-1;a=getchar();	}
	while(a<='9'&&a>='0'){x=(x<<3)+(x<<1)+(a^48);a=getchar();}
	return x*w;
}

int main()
{
	n=qr();
	cin>>x;
	x*=100;
	double sum=0;
	for(register int i=1;i<=n;i++)
	{
		cin>>a[i]>>b[i];
		sum+=a[i]*b[i];
		if(sum>x)
		{
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<"-1"<<endl;
	return 0;
} 