#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  int x, a, b, n;
  int mx, mxdif;
  int rem, ans;
  while (T--) {
    mx = -1;
    mxdif = -2e9;
    cin >> n >> x;
    while (n--) {
      cin >> a >> b;
      if (mx < a) mx = a;
      if (mxdif < a - b) mxdif = a - b;
    }
    if (mxdif <= 0) {
      if (mx >= x)
        cout << 1 << endl;
      else
        cout << -1 << endl;
    } else {
      rem = x - mx;
      if (rem <= 0) {
        cout << 1 << endl;
      } else {
        ans = rem / mxdif;
        if (rem % mxdif == 0)
          ans++;
        else
          ans += 2;
        cout << max(1, ans) << endl;
      }
    }
  }
}
