#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long gcd(long long x, long long y) {
  long long r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
long long lcm(long long x, long long y) {
  x /= gcd(x, y);
  y /= gcd(x, y);
  return (x * y);
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, h, ret = 0;
  cin >> n >> h;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  sort((b).rbegin(), (b).rend());
  sort((a).rbegin(), (a).rend());
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  for (int i = 0; i < n; i++) {
    if (a[0] > b[i]) break;
    h -= b[i];
    ret++;
    cout << h << endl;
    if (h <= 0) break;
  }
  if (h <= 0) {
    cout << ret << endl;
  } else {
    cout << ret + (h + a[0] - 1) / a[0] << endl;
  }
  return 0;
}
