#include <bits/stdc++.h>
int solve(int x, int max_cut, int max_dec) {
  if (x <= max_cut) return 1;
  if (max_dec == 0) return -1;
  return ((x - max_cut) + (max_dec - 1)) / max_dec + 1;
}
int main() {
  int tests;
  scanf("%d", &tests);
  for (int test = 1; test <= tests; ++test) {
    int n, x;
    scanf("%d %d", &n, &x);
    int max_cut = 0, max_dec = 0;
    for (int i = 0; i < n; ++i) {
      int d, h;
      scanf("%d %d", &d, &h);
      max_dec = std::max(max_dec, d - h);
      max_cut = std::max(max_cut, d);
    }
    int ans = solve(x, max_cut, max_dec);
    printf("%d\n", ans);
  }
  return 0;
}
