#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define sz(a) ((int)a.size())
#define re return
#define all(a) a.begin(),a.end()
#define int long long
#define Type int
#define rept(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,a) rept(i,0,a)
using namespace std;
signed main()
{
	int n,m;
	cin>>n>>m;m*=100;
	int tot=0;
	rep(i,n){
		int a,b;
		cin>>a>>b;
		tot+=a*b;
		if (tot>m) re cout<<i+1,0;
	}
	cout<<-1;
	re 0;
}

#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 4000000000000000000 //オーバーフローに注意
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



ll mod_pow(ll x,ll count, ll mod){

	if(count == 0)return 1;
	ll ret = mod_pow((x*x)%mod,count/2,mod);
	if(count%2 == 1){

		ret = (ret*x)%mod;
	}
	return ret;
}
int main(){

	ll N,M;
	scanf("%lld %lld",&N,&M);

	ll tmp = mod_pow(10,N,M*M);

	printf("%lld\n",(tmp/M)%M);

	return 0;
}
