#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define endl "\n"

#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
	fast;
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif


ll n,x;
cin>>n>>x;

vector<ll> v(n,0),p(n,0);

for(ll i=0;i<n;i++)
{
	cin>>v[i]>>p[i];
}


ll a=-1;
ll k=0;

for(ll i=0;i<n;i++)
{
	k+=v[i]*p[i];

	if(k>x*100)
	{
		a=i+1;
		break;
	}

}



cout<<a;













	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
using Graph = vector<vector<int>>;
using Graphl = vector<vector<ll>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define FOR(itr, v) for (auto itr = (v).begin(); itr != (v).end(); ++itr)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
#define rALL(a)  (a).rbegin(),(a).rend()
#define ERASE(a)  (a).erase(unique((a).begin(), (a).end()), (a).end()); // sortしてから
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> void PrintVector(const vector<T> &vec) {for (auto val : vec) cout << val << " "; cout << endl;}
const long long INF = 1LL << 60;
const long long minusINF = -(1LL << 40);
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;

#define pu(x) cout << (x) << endl
int main()
{
	int n, x; cin >> n >> x;
	int v, p;
	x *= 100;
	rep(i, n)
	{
		cin >> v >> p;
		x = x - v * p;
		if (x < 0)
		{
			pu(i + 1);
			return (0);
		}
	}
	pu(-1);
}
