#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ii = pair<long long, long long>;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
namespace input {
template <typename T>
bool re(T&& t) {
  return (cin >> t) ? 1 : 0;
}
template <typename T1, typename T2>
void re(pair<T1, T2>& t) {
  re(t.first);
  re(t.second);
}
template <typename T1, typename T2>
void re_v(const T1& n, vector<T2>& v) {
  for (long long i = 0; i < n; ++i) {
    T2 in;
    re(in);
    v.push_back(in);
  }
}
template <typename T, typename... Args>
bool re(T&& t, Args&&... args) {
  re(t);
  return re(args...);
}
}  // namespace input
namespace output {
template <typename T>
void ou(const T& t) {
  cout << t;
}
template <typename T1, typename T2>
void ou(const pair<T1, T2>& t) {
  ou(t.first);
  ou(t.second);
}
template <typename T>
void ou_v(const vector<T>& v) {
  for (auto it = v.begin(); it != v.end(); ou(*it++))
    if (it != v.cbegin()) ou(' ');
}
template <typename T, typename... Args>
void ou(const T& t, const Args&... args) {
  ou(t);
  ou(' ');
  ou(args...);
}
}  // namespace output
using namespace input;
using namespace output;
namespace DEBUG {
template <typename T>
void _de(const T& t) {
  cerr << t;
}
template <typename T1, typename T2>
void _de(const pair<T1, T2>& t) {
  cerr << '(' << t.first << ", " << t.second << ')';
}
template <typename T>
void pary(T t1, T t2) {
  cerr << "[";
  for (auto t = t1; t != t2; _de(*t++))
    if (t != t1) cerr << ", ";
  cerr << "]\n";
}
template <typename T, typename... Args>
void _de(const T& t, const Args&... args) {
  cerr << t << ' ';
  _de(args...);
}
}  // namespace DEBUG
signed main() {
  long long ___T;
  cin >> ___T;
  while (___T--) {
    long long n, x;
    re(n, x);
    long long mahurt{-1}, ma{-1};
    for (long long q = 0; q < n; ++q) {
      long long d, h;
      re(d, h);
      mahurt = max(d - h, mahurt);
      ma = max(ma, d);
    }
    if (mahurt <= 0 && ma < x)
      ou("-1\n");
    else {
      if (ma >= x)
        ou("1\n");
      else
        cout << 1 + (x - ma + mahurt - 1) / mahurt << '\n';
    }
  }
}
