// Created at 2021/01/23 20:56
// {TODO}WA, {TODO}min, {TODO}diff
#include <bits/stdc++.h>
//#include <atcoder/all>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, n) for (lint i = 0, i##_len = n; i < i##_len; i++)
#define rep2(i, n) for (lint i = 1, i##_len = n; i <= i##_len; i++)
#define rep3(i, s, e) for (lint i = s, i##_len = e; i < i##_len; i++)
#define all(i) (i).begin(), (i).end()
#define print(s) cout << s << "\n";
#define print2(s1, s2) cout << s1 << " " << s2 << "\n";
#define mk_p make_pair
using namespace std;
//using namespace atcoder;
using lint = long long;
using pi = pair<int, int>;
using pl = pair<lint, lint>;
using vi = vector<int>;
using vl = vector<lint>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using qi = queue<int>;
using ql = queue<lint>;
constexpr int INF = 1 << 30;
constexpr lint INFl = 1LL << 62;

template<class T, class U>
istream &operator>>(istream &is, pair <T, U> &pair) {
    is >> pair.first >> pair.second;
    return is;
}

template<class T, class U>
ostream &operator<<(ostream &os, pair <T, U> &pair) {
    os << pair.first << " " << pair.second << "\n";
    return os;
}

template<class T>
istream &operator>>(istream &is, vector <T> &vec) {
    for (auto &v : vec) is >> v;
    return is;
}

template<class T>
ostream &operator<<(ostream &os, const vector <T> &vec) {
    os << '[';
    for (auto v : vec) os << v << ',';
    os << ']';
    return os;
}

template<class T>
inline bool chmax(T &a, T b) {
    if (b > a) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
T gcd(T x, T y) {
    if (x == 0) {
        if (y == 0)
            return 1;
        else
            return y;
    }
    if (y == 0) return x;
    if (x % y == 0)
        return y;
    else
        return gcd(y, x % y);
}

template<class T>
inline T lcm(T x, T y) {
    return x / gcd(x, y) * y;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    // cout << fixed << setprecision(15);
    /*----------------------------------------------------*/
    int n, x; cin >> n >> x;
    x *= 100;
    vpi vp(n); cin >> vp;
    int now = 0;
    rep(i, n) {
        now += vp.at(i).first * vp.at(i).second;
        if (now > x) {
            print(i + 1)
            return 0;
        }
    }
    print(-1)
}
// map->bucket?
// あまり->非負か確認
// set? multiset?
// オーバーフロー確認(最大値を求める)
// 入力確認
// 型確認
// ループ回数確認(TLE)
// 小数の計算は避けよう(割り算)(0割りだめ！絶対！)
// Python を使っては?
// 擬似コードを作っては?
// 汚くてもok

#include <bits/stdc++.h>
using namespace std;
#define let const auto
#define var auto
#define ref var &
#define cref let &
typedef uint32_t uint;
typedef int64_t int64;
typedef uint64_t uint64;
template<class T>
T read() {
  T x;
  cin >> x;
  return x;
}

let MULTIPLE_TEST_CASES = false;

void solve() {
  let n = read<uint>();
  var k = read<int64>();
  var friends = vector<pair<int64, int64>>(n);
  for (uint i = 0; i < n; i++) {
    cin >> friends[i].first;
    cin >> friends[i].second;
  }
  sort(friends.begin(), friends.end());
  int64 curr = 0;
  for (cref p : friends) {
    let max = curr + k;
    if (max >= p.first) {
      k -= p.first - curr;
      k += p.second;
      curr = p.first;
    } else {
      curr += k;
      k = 0;
      break;
    }
  }
  curr += k;
  cout << curr;
}

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  let testCases = MULTIPLE_TEST_CASES ? read<uint>() : 1;
  for (uint testCase = 1; testCase <= testCases; testCase++) {
    solve();
  }
}

