#include <bits/stdc++.h>
using namespace std;
namespace IO {
template <class T>
inline bool read(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
}  // namespace IO
namespace Utility {
template <typename T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <typename T>
T lcm(T a, T b) {
  return (a / gcd(a, b) * b);
}
template <typename T>
inline T addmod(T a, T b, T mod) {
  T c = a + b;
  return c > mod ? c - mod : c;
}
template <typename T>
inline T submod(T a, T b, T mod) {
  T c = a - b;
  return c < mod ? c + mod : c;
}
template <typename T>
inline T mulmod(T a, T b, T mod) {
  return a * 1LL * b % mod;
}
template <typename T>
T exEuclid(T a, T b, T &x, T &y) {
  x = 0, y = 1;
  if (a == 0) return b;
  T x1, y1;
  T d = exEuclid(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
template <typename T>
T modInv(T a, T mod) {
  T x, y;
  exEuclid(a, mod, x, y);
  return x < 0 ? x + mod : x;
}
template <typename T>
T bigmod(T b, T p, T mod) {
  T ret = b > 0;
  while (p) {
    if (p & 1) ret = mulmod(ret, b, mod);
    p >>= 1, b = mulmod(b, b, mod);
  }
  return ret;
}
}  // namespace Utility
using namespace IO;
using namespace Utility;
const int INF = 2000000009;
const int MX = 1000005;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const int MOD = 1000000007;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n = ({
      long long a;
      read(a);
      a;
    }),
              x = ({
                long long a;
                read(a);
                a;
              }),
              d = 0, h = 0, dif = 0, dd = 0, hh = 0, b;
    bool flag = false;
    for (int i = 0; i < n; i++) {
      dd = ({
        long long a;
        read(a);
        a;
      }),
      hh = ({
        long long a;
        read(a);
        a;
      });
      d = max(dd, d);
      if (dd - hh > dif) {
        dif = max(dif, dd - hh);
        h = hh;
      }
      if (dd >= x) flag = true;
    }
    if (flag)
      cout << "1\n";
    else if (dif == 0)
      cout << "-1\n";
    else {
      x -= d;
      long long ans = ceil((double)x / (double)dif);
      cout << ans + 1 << '\n';
    }
  }
  return 0;
}
