#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n, h;
  cin >> n >> h;
  priority_queue<pair<int, int>> k, t;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    k.push({a, i});
    t.push({b, i});
  }
  int sum = 0;
  int mx = 0;
  int ans = 0;
  t.push({-1, -1});
  while (sum < h) {
    pair<int, int> x = k.top();
    pair<int, int> y = t.top();
    if (h - sum <= mx) {
      sum += mx;
      ans++;
    } else if (x.first < y.first && x.second != y.second) {
      t.pop();
      sum += y.first;
      ans++;
    } else if (x.first < y.first) {
      mx = max(mx, y.first);
      t.pop();
    } else {
      ans += (h - sum - mx + x.first - 1) / x.first;
      sum += h - sum - mx;
    }
    cout << sum << " " << ans << endl;
  }
  cout << ans << endl;
}
