#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
#define SIZE(x) ll(x.size())
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
typedef pair<int, int> P;
int main()
{
    ll N, X;
    cin >> N >> X;
    ll res = 0;
    X *= 100;
    int ans = 0;
    rep(i, N) {
        ll V, P;
        cin >> V >> P;
        res += V * P;
        ans++;
        if (X < res) {
            cout << ans << endl;
            return 0;
        }
    }

    cout << -1 << endl;


    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long

int32_t main() {

#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.in", "w", stdout);
#endif

	int n, k;

	cin >> n >> k;
	int cnt = 0;
	int ml = 0;
	vector<pair<int, int>> vp;
	for (int i = 0; i < n; i++) {
		int v, p;
		cin >> v >> p;
		vp.push_back(make_pair(v, p));
	}
	k *= 100;
	for (int i = 0; i < n; i++) {
		int v, p;
		v = vp[i].first, p = vp[i].second;
		v *= p;
		ml += v;
		cnt++;
		if (ml > k) {
			cout << cnt << "\n";
			return 0;
		}
	}
	cout << "-1\n";

	return 0;
}