#include <bits/stdc++.h>
using namespace std;
struct skil {
  int heal, bro;
} skill[20005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, hp;
    cin >> n >> hp;
    int max1 = -1, max2 = -1;
    for (int i = 0; i < n; i++) {
      cin >> skill[i].bro >> skill[i].heal;
      max1 = max(max1, skill[i].bro);
      max2 = max(max2, (skill[i].bro - skill[i].heal));
    }
    if (max1 >= hp) {
      cout << 1 << endl;
      continue;
    }
    if (max2 <= 0 && max1 < hp) {
      cout << -1 << endl;
      continue;
    }
    int res = (hp - max1) / max2 + 1;
    if ((hp - max1) % max2) res++;
    cout << res << endl;
  }
}
