#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  for (scanf("%d", &T); T--;) {
    int n, hp;
    scanf("%d%d", &n, &hp);
    int max_dam = 0, max_dec = 0;
    for (int i = 0; i < n; i++) {
      int dam, rec;
      scanf("%d%d", &dam, &rec);
      max_dam = max(dam, max_dam);
      max_dec = max(dam - rec, max_dec);
    }
    int ans = 0;
    if (max_dam >= hp)
      ans = 1;
    else if (max_dec == 0)
      ans = -1;
    else {
      int todo = hp - max_dam;
      ans = (todo - 1) / max_dec + 1 + 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
