#include <bits/stdc++.h>
using namespace std;
int T, n, h, b, d, maxdel, maxhurt;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int main() {
  T = read();
  while (T--) {
    n = read(), h = read();
    maxdel = maxhurt = 0;
    for (int i = 1; i <= n; ++i) {
      b = read(), d = read();
      maxdel = max(maxdel, b - d);
      maxhurt = max(maxhurt, b);
    }
    if (maxhurt >= h) {
      printf("1\n");
      continue;
    }
    if (maxdel == 0) {
      printf("-1\n");
      continue;
    }
    printf("%d\n", (h - maxhurt - 1) / maxdel + 2);
  }
  return 0;
}
