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

int n,x;
double now;
int main() {
	cin>>n>>x;
	x*=100;
	for(int i=1,v,p;i<=n;i++) {
		cin>>v>>p;
		x-=v*p;
		if(x<0) {cout<<i<<endl;return 0;}
	}
	cout<<-1;
	return 0;
}

//-----------------------------------------------MACROS----------------------------------------------------------------------
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define lld long double
#define all(a) a.begin(),a.end()
#define fi first
#define sc second
#define pii pair<int,int>
#define FOR(sz) for(int i = 0; i < sz; i++)
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
//-----------------------------------------------MACROS----------------------------------------------------------------------

//---------------------------------------------DEBUGGER-----------------------------------------------------------------------
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif

void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
//---------------------------------------------DEBUGGER-----------------------------------------------------------------------

//TO-DO ll V/s int?

int t;
ll n;
ll f(ll m) {
	ll x = (ll)((100 + t) * m)/100;
	return x;
}
void solve() {
   cin >> t >> n;
   ll l = 1;
   ll r = 1e12 + 1;
   while(r > l + 1) {
   	ll  mid = (l+r)/2;
   	if(f(mid) - mid < n) {
   		l = mid;
   	}
   	else
   		r = mid;
   }
   cout << f(l) + 1;
}

int main(){
  IOS;
  #ifndef ONLINE_JUDGE
      freopen("input.txt","r", stdin);
      freopen("output.txt", "w" , stdout);
      freopen("Error.txt","w",stderr);
  #endif
  int tc = 1;
 //cin >> tc;
  while(tc--) {
    solve();
  }
  return 0;
}