#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
//#include <atcoder/all>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  ll N,X; cin >> N >> X;
  vector<ll> V(N);
  vector<ll> P(N);
  rep(i,N) cin >> V[i] >> P[i];
  ll now = 0;
  rep(i,N){
    now += V[i]*P[i];
    if(now>X*100){
      cout << i+1 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools

#include <bits/stdc++.h>
// #include "atcoder/all"

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;


template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}


// doc: https://shibh308.github.io/library/library/lib/classes/unionfind.cpp.html
struct UnionFind{
    vector<int> par;
    int count;
    UnionFind(int n) : par(n, -1), count(0){}
    int Find(int x){return par[x] < 0 ? x : Find(par[x]);}
    int Size(int x){return par[x] < 0 ? -par[x] : Size(par[x]);}
    bool Unite(int x, int y){
        x = Find(x);
        y = Find(y);
        if(x == y)
            return false;
        if(par[x] > par[y])
            swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return ++count;
    }
};


signed main(){
    int n, m;
    cin >> n >> m;
    vector<vector<int>> edges(n);
    UnionFind uf(n);
    for(int i = 0; i < m; ++i){
        int x, y;
        cin >> x >> y;
        edges[--x].emplace_back(--y);
        edges[y].emplace_back(x);
        uf.Unite(x, y);
    }

    vector<vector<int>> fl(n);
    for(int i = 0; i < n; ++i){
        assert(uf.Find(i) < n);
        fl[uf.Find(i)].emplace_back(i);
    }

    vector<i64> cn(n, 0);
    vector<int> col(n);
    function<void(int,int)> f = [&](int k, int p){
        if(p == fl[k].size()){
            ++cn[k];
            return;
        }
        int x = fl[k][p];
        for(int j = 0; j < 3; ++j){
            bool fp = true;
            for(auto y : edges[x]){
                if(col[y] == j){
                    fp = false;
                    break;
                }
            }
            if(fp){
                col[x] = j;
                f(k, p + 1);
                col[x] = -1;
            }
        }
    };

    for(int i = 0; i < n; ++i){
        col.assign(n, -1);
        f(i, 0);
    }

    i64 ais = accumulate(cn.begin(), cn.end(), 1LL, [](auto x, auto y){return x * y;});
    cout << ais << endl;

    return 0;
}
