#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, sum;
	x *= 100;
	rep(i, n)
	{
		cin >> v >> p;
		sum += v * p;
		if (sum > x)
		{
			pu(i + 1);
			return (0);
		}
	}
	pu(-1);
}
#include<bits/stdc++.h>

using namespace std;

const int maxN = 5009;
int N, M, p[maxN], pM[maxN];
const int mod = 998244353;

int add (int x, int y) {int ans = x + y; if (ans >= mod) ans -= mod; return ans;}
int subtract (int x, int y) {if (x >= y) return x - y; return x - y + mod;}
int mul (int x, int y) {return 1LL * x * y % mod;}
void adto (int &x, int y) {x += y; if (x >= mod) x -= mod;}

int power (int a, int b)
{
    int p = 1;
    for (int i=0; (1<<i) <= b; i++)
    {
        if (b & (1 << i)) p = mul (p, a);
        a = mul (a, a);
    }
    return p;
}

int fac[2000009], inv[2000009];
void Prec (int lim){fac[0] = inv[0] = 1;for (int i=1; i<=lim; i++)fac[i] = mul (fac[i - 1], i);
inv[lim] = power (fac[lim], mod - 2);for (int i=lim - 1; i>=0; i--)inv[i] = mul (inv[i + 1], i + 1);}
int comb (int N, int K){if (K > N || N < 0 || K < 0) return 0; int ans = mul (fac[N], inv[N - K]);ans = mul (ans, inv[K]);return ans;}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d", &N, &M);
pM[0] = 1;
for (int i=1; i<=N; i++)
    pM[i] = mul (pM[i - 1], M);
for (int i=1; i<=M; i++)
    p[i] = 1;
int ans = 0;
for (int l=1; l<=N; l++)
{
    for (int j=1; j<=M; j++)
        p[j] = mul (p[j], j);
    int s0 = 0, s1 = 0, s2 = 0;
    for (int j=1; j<=M; j++)
    {
        int curr = subtract (p[M - j + 1], p[M - j]); ///how many arrays of length n have the minimum precisely j
        adto (s2, mul (curr, mul (j - 1, j - 1)));
        adto (s1, mul (curr, j - 1));
        adto (s0, curr);
    }
    for (int i=1; i + l - 1 <= N; i++)
        if (i == 1 && i + l - 1 == N)
            adto (ans, s0);
        else
        if (i == 1 || i + l - 1 == N)
            adto (ans, mul (s1, pM[N - l - 1]));
        else
            adto (ans, mul (s2, pM[N - l - 2]));
}
printf ("%d\n", ans);
return 0;
}
