#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T>& a) {
  os << "{";
  for (size_t i = 0; i < a.size(); ++i) os << (i > 0 ? "," : "") << a[i];
  return os << "}";
}

constexpr ll MOD = 1000000007;
constexpr int INF = 0x3f3f3f3f;
constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;

template <typename T, typename C>
ostream& operator<<(ostream& os, const multiset<T, C>& v) {
  os << '{';
  for (auto it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  os << '}';

  return os;
}
template <typename T1, typename T2, typename C>
ostream& operator<<(ostream& os, const map<T1, T2, C>& mp) {
  os << '[';
  for (auto it = mp.begin(); it != mp.end(); it++) {
    if (it != mp.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  os << ']';

  return os;
}

int main() {
  int h, w;
  cin >> h >> w;
  // 右へ動く最小値を保管
  // ある点から始まった場合、
  // 複数の最短経路結果を持ちたい。
  //

  map<int, int> mp;
  multiset<int> st;
  rep(i, 0, w) {
    mp[i] = i;
    st.insert(0);
  }

  rep(i, 0, h) {
    int a, b;
    cin >> a >> b;
    --a;
    // [a, b]はいけない
    auto itr = mp.lower_bound(a);
    int most_right = -1;
    while (itr != mp.end() && itr->first <= b) {
      most_right = max(most_right, itr->second);
      int x = itr->first - itr->second;
      st.erase(st.find(x));
      itr = mp.erase(itr);
    }

    if (most_right != -1 && b < w) {
      st.insert(b - most_right);
      mp[b] = most_right;
    }
    if (st.size() > 0)
      cout << *st.begin() + i + 1 << '\n';
    else
      cout << -1 << '\n';
  }
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF=1e18;

int main(){
    ll d, g;
    ll min = INF;
    cin >> d >> g;
    vector<ll> p(d);
    vector<ll> c(d);
    for(int i = 0; i < d; i++) {
        cin >> p.at(i) >> c.at(i);
    }
    // {0, 1, ..., n-1} の部分集合の全探索
    for (int bit = 0; bit < (1<<d); ++bit)
    {
        int max_index = -1;
        ll score = 0, problem = 0;
        /* bit で表される集合の処理を書く */
        bitset<10> tmp(bit);
        /* bit で表される集合の処理を書く */
        for(int i = 0; i < d; i++){
            if(tmp.test(i)) {
                score += p.at(i) * (i+1) * 100 + c.at(i);
                problem += p.at(i);
            }
            else max_index = i;
        }

        if(problem > min) continue;
        if(score == 0){
            while(score < g) {
                problem++;
                score += (max_index + 1) * 100;
                if(problem > p.at(max_index)) {
                    problem = INF;
                    break;
                }
            }

        }
        else if(g > score && g - score < p.at(max_index) * 100 * (max_index+1)) {
            problem += (g - score) / (max_index+1) / 100;
        }
        else if(g > score) continue;
        
        if(problem < min) min = problem;
    }
    cout << min << endl;
}