#include <bits/stdc++.h>
int max(int a, int b) { return a >= b ? a : b; }
int min(int a, int b) { return b >= a ? a : b; }
int sei(int a) { return a > 0 ? a : 0; }
int factorial(int n) {
  if (n > 0)
    return n * factorial(n - 1);
  else
    return 1;
}
int compare_up_int(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}
int compare_up_longint(const void *a, const void *b) {
  return *(long int *)a - *(long int *)b;
}
int compare_down_int(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}
int euclid(int a, int b) {
  if (a < b) {
    int tmp = a;
    a = b;
    b = tmp;
  }
  int r = a % b;
  if (r < 0) r += b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
    if (r < 0) r += b;
  }
  return b;
}
int main() {
  long int N, H, count = 0, kai = 0;
  int minc = INT_MAX, minb = INT_MAX, mina = INT_MAX;
  scanf("%ld %ld", &N, &H);
  long int a[N], b[N], c[N];
  for (int i = 0; i < N; i++) scanf("%ld %ld", &a[i], &b[i]);
  for (int i = 0; i < N; i++) {
    c[i] = b[i] - a[i];
    if (c[i] < minc) {
      minb = b[i];
      minc = c[i];
      mina = a[i];
    }
    count += b[i];
    if (count >= H) {
      kai = i + 1;
      printf("%ld", kai);
      return 0;
    }
  }
  printf("%ld", N - 1 + (H - count + minb) / mina);
  return 0;
}
