#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read()
{
	int x=0,flag=1;
	char ch=getchar();
	while(ch<'0'||ch>'9')
	{
		if(ch=='-')
			flag=0;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')
	{
		x=(x<<1)+(x<<3)+ch-'0';
		ch=getchar();
	}
    return (flag?x:~(x-1));
}
int n,x,v,p;
signed main()
{
	n=read();
	x=read()*100;
	for(int i=1;i<=n;i++)
	{
		v=read();
		p=read();
		x-=v*p;
		if(x<0)
		{
			cout<<i;
			return 0;
		}
	}
	cout<<-1;
	return 0;
}

#include <iostream>

using namespace std;

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

  if (vsum <= x)
    cout << -1 << endl;
}
