#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define N 100005
#define MOD 1000000007
#define dd double
#define vi vector<int>
#define vll vector<ll>
#define forr(i,n) for(ll i=0;i<n;i++)
#define revf(i,n) for(ll i=n-1;i>=0;i--)
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep1(i,b) for(ll i=1;i<=b;i++)
#define inp(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define outp(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "
#define outp1(a,n) for(ll i=1;i<n;i++)cout<<a[i]<<" "
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) (((a)*(b))/gcd((a),(b)))
#define pb push_back
#define mp make_pair
#define BINSC binary_search
#define BITOUT __builtin_popcount
#define mem(x,n) memset(x,n,sizeof(x))
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define cn cout<<"\n";
int main()
{
     fast
     ll n,x;
     cin>>n>>x;
     ll v[n],p[n];
     forr(i,n)
     cin>>v[i]>>p[i];
     ll s=0,s1=-1;
     forr(i,n)
     {
          s+=v[i]*p[i];
          if(s>x*100)
          {
               s1=i;break;
          }
     }
     if(s1!=-1)
     cout<<s1+1;
     else
     cout<<-1;
}
/*
 *    author:    Apiram
 *    created:   23.01.2021 17:34:22
*/

#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int64_t n;
int64_t k;
cin>>n>>k;
k*=100;
vector<int64_t>arr(n);
for (auto i =0;i<n;++i){
	int64_t a,b;
	cin>>a>>b;
	arr[i]=a*b;
	
} 
int64_t i=0;
while(k>=0&&i<n){
	k-=arr[i];
	++i;
}
if (k<0)
cout<<i;
else cout<<-1;
return 0;}