#include <bits/stdc++.h>
using namespace std;
const long long N = 200005, INF = 2000000000000000000;
long long power(long long a, long long b, long long p) {
  if (a == 0) return 0;
  long long res = 1;
  a %= p;
  while (b > 0) {
    if (b & 1) res = (res * a) % p;
    b >>= 1;
    a = (a * a) % p;
  }
  return res;
}
vector<long long> prime;
bool is_composite[N];
void sieve(long long n) {
  memset(is_composite, false, sizeof(is_composite));
  for (long long i = 2; i < n; ++i) {
    if (!is_composite[i]) prime.push_back(i);
    for (long long j = 0; j < prime.size() && i * prime[j] < n; ++j) {
      is_composite[i * prime[j]] = true;
      if (i % prime[j] == 0) break;
    }
  }
}
void print(bool n) {
  if (n) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long T;
  cin >> T;
  while (T--) {
    long long n, x;
    cin >> n >> x;
    long long d[n], h[n];
    long long max_blow = 0, max_profit = 0;
    for (long long i = 0; i < n; i++) {
      cin >> d[i] >> h[i];
      max_blow = max(max_blow, d[i]);
      max_profit = max(max_profit, d[i] - h[i]);
    }
    long long ans = x > 0 ? INF : 0;
    x -= max_blow;
    ans = 1;
    if (x > 0) {
      if (max_profit == 0) {
        ans = -1;
      } else
        ans += x / max_profit + (x % max_profit > 0);
    }
    cout << ans << "\n";
  }
}
