#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n, x, a, b, mx, mxd;
  scanf("%d", &T);
  while (T--) {
    mx = 0, mxd = 0;
    scanf("%d %d", &n, &x);
    for (int i = 0; i < n; i++) {
      scanf("%d %d", &a, &b);
      mx = max(mx, a);
      mxd = max(mxd, a - b);
    }
    x -= mx;
    if (x <= 0) {
      printf("1\n");
      continue;
    } else if (!mxd) {
      printf("-1\n");
    } else {
      printf("%d\n", x / mxd + (x % mxd ? 1 : 0) + 1);
    }
  }
}
