#include <iostream>
using namespace std;
int main()
{
  int n;
  double x;
  cin >> n >> x;
  x *= 100;
  for (int i = 0; i < n; i++)
  {
      int v, p;
      cin >> v >> p;
      x -= v * p;
      if (x < 0)
      {
          cout << i+1; return 0;
      }
      else {if (i == n-1)
      {
          cout <<  -1; return 0;
      }}
  }
}

#include <cstdio>
#include <vector>
using namespace std;

int main(int argc, char** argv)
{
	char c, s[200005];
	int len = 0;
	while((c = getchar()) != '\n');
	while((c = getchar()) != '\n')
	{
		s[len++] = c;
		if(len >= 3 && s[len - 3] == 'f'
					&& s[len - 2] == 'o'
					&& s[len - 1] == 'x')
			len -= 3;
	}
	printf("%d\n", len);
	return 0;
}