#include <bits/stdc++.h>
using namespace std;
long long N;
long long H;
long long aa[100010];
long long bb[100010];
void sort2vectors(vector<long long> &av, vector<long long> &bv) {
  long long n = av.size();
  vector<long long> av2, bv2;
  for (long long i = 0, max = INT_MIN; i < n; i++) {
    long long k = 0, min = INT_MAX;
    for (long long j = 0; j < n; j++) {
      if (max < av[j] && av[j] < min) {
        k = j;
        min = av[j];
      }
    }
    av2.push_back(av[k]);
    bv2.push_back(bv[k]);
    max = av[k];
  }
  av = av2;
  bv = bv2;
}
int main() {
  cin >> N >> H;
  long long A = 0, B = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &aa[i], &bb[i]);
    A += aa[i];
    B += bb[i];
  }
  vector<long long> a(aa, aa + sizeof(aa) / sizeof(long long));
  vector<long long> b(bb, bb + sizeof(bb) / sizeof(long long));
  sort2vectors(a, b);
  long long x = 0;
  if (H > B) {
    x = (H - B) / a[N - 1];
    if ((H - B) % a[N - 1]) x += 1;
    H = H - B;
  }
  long long imax = N - 1;
  while (H > 0) {
    if (b[imax] > a[imax]) {
      H -= b[imax];
      imax -= 1;
    } else {
      H -= a[imax];
    }
    x += 1;
  }
  cout << x << " " << H << endl;
}
