#include <bits/stdc++.h>
using namespace std;
#define rep(i,t,n) for(int64_t i=t;i<n;i++)
#define Sort(a) sort(a.begin(),a.end())
#define rSort(a,n,m) sort(a.begin()+n-1,a.begin()+m)
#define Reverse(a) reverse(a.begin(),a.end())
#define rReverse(a,n,m) reverse(a.begin()+n-1,a.begin()+m)
#define MOD 1000000007
#define sign(i) -1*pow(-1,i)
#define vi(A,N,i)  vector<int64_t> A(N,i)
#define vs(A,N,i)  vector<string> A(N,i)
#define vb(A,N,i)  vector<bool> A(N,i)
#define INF ((1LL<<62)-(1LL<<31))
//((a+b+c)-max(a,max(b,c))-min(a,min(b,c)))

/*template <class T>

}*/


//cout << fixed << setprecision(桁数);

int64_t def_str(string x,string y){
  int64_t def=0;
  rep(i,0,(int64_t)x.size()){
    if(x[i]!=y[i]){
      def++;
    }
  }
  return def;
}

int main() {
  int64_t a,b,c,d,e,f,ans=0,now_ans=0,mlt_ans=1;
  //double a,b,c,d,e,f,ans=0,now_ans=0,mlt_ans=1;
  string x,y,z;
  char s,t,u;
  bool frag=false,frag1=false,frag2=false;
  vector<int64_t> A{},B{};
  vector<string> C{},D{};
  vector<char> E{},F{};
  vector<bool> G(26,false);
  cin>>a>>b;
  //cin>>x>>y;
  //cin>>s>>t;////////////////////////
  
  
  rep(i,0,a){
    cin>>c>>d;
    ans+=c*d;
    if(ans>b*100){
      cout<<i+1;
      return 0;
    }
  }
  cout<<-1;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
  long long N,X;
  cin>>N>>X;
  long long total=0;
  long long count=0;
  bool jud=0;
  for(long long a=0;a<N;a++){
    long long v,p;
    cin>>v>>p;
    total+=v*p;
    count++;
    if(total>(100*X)){
      
      jud=1;
      break;
    }
  }
  //cout<<total<<endl;
  if(jud){
    cout<<count;
  }
  else{
    cout<<"-1";
  }


}
