#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long 
#define pb(e) push_back(e)
#define sv(a) sort(a.begin(),a.end())
#define sa(a,n) sort(a,a+n)
#define mp(a,b) make_pair(a,b)
#define vf first
#define vs second
const int inf = 0x3f3f3f3f;
int mod = 1000000007; 
bool remender(ll a , ll b){return a%b;}
int p[200005],siz[200005];

int get(int x){
	return p[x]=(x==p[x] ? x : get(p[x]));
}

void unio(int u , int v){
	int a = get(u);
	int b=get(v);
	if(a==b)return;
	if(siz[a]>siz[b])swap(a,b);
	p[b]=a;
	siz[a]+=siz[b];
}

void solve(){
	ll n;ll k;
	ll d=0;
	cin>>n>>k;
	bool bb = 0;
	for(int i = 0; i < n; i++){
		ll a,b;
		cin>>a>>b;
		if((a*b)%100LL){
			d+=(a*b)%100LL;
		}
		k-=(a*b)/100LL;
		if(d >= 100LL){
			d%=100LL;
			k--;
		}
		if(k < 0 || (k==0 && d)){
			if(bb==0){
			cout<<i+1<<'\n';
			bb=1;
		}
		}
	}
	if(bb){
		return;
	}
	cout<<-1<<'\n';
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
	//int t;cin >> t;while(t--)
	solve();
	return 0;
}

//#pragma GCC optimize ("Ofast,unroll-loops")
//#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unistd.h>
#define FAST_IO ios::sync_with_stdio(0);cin.tie(NULL)
#define all(v) (v).begin(),(v).end()
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long Long;
typedef long double Double;
typedef unsigned long long ULong;
typedef pair<Long, Long> Pair;

const int N = 1e6;
const Long INF = 1e18;
const Double EPS = 1e-9;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
Long random(Long a, Long b) { return uniform_int_distribution<Long> (a, b) (rng); }

void Solve(void) {
  Long n, x;
  cin >> n >> x;
  vector<Pair> a(n);
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  Long cur = 0;
  for (int i = 0; i < n; i++) {
    cur += a[i].first * a[i].second;
    if (cur > 100LL * x) {
      cout << i + 1 << '\n';
      return;
    }
  }
  cout << -1 << '\n';
}

int main(void) {
  FAST_IO;
  int t = 1;
  //cin >> t;
  while (t--) Solve();
  return 0;
}
