#include <bits/stdc++.h>
using namespace std;
const long long M = 100000000;
int n;
inline void input() {
  std::ios_base::sync_with_stdio(false);
  cin >> n;
}
inline void do_stuff() {
  long long m, x;
  for (int i = 0; i < n; i++) {
    cin >> m >> x;
    int d = 0, f = 0;
    for (int j = 0; j < m; j++) {
      int t1, t2;
      cin >> t1 >> t2;
      if (t1 - t2 > d) d = t1 - t2;
      if (t1 > f) f = t1;
    }
    if (d) {
      int t = max((x - f + d - 1) / d, 0LL);
      t++;
      cout << t << endl;
    } else if (f >= x)
      cout << 1 << endl;
    else
      cout << -1 << endl;
  }
}
inline void output() {}
int main() {
  input();
  do_stuff();
  output();
  return 0;
}
