#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int INF = 1e9 + 1233;
const long long LINF = 1e18 + 1233;
template <typename T>
void print(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
}
template <typename T>
void input(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cin >> a[i];
}
struct head {
  long long d, h;
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    vector<head> a(n);
    for (int i = 0; i < n; i++) cin >> a[i].d >> a[i].h;
    long long MaxDmg = -1;
    for (int i = 0; i < n; i++) MaxDmg = max(MaxDmg, a[i].d);
    long long MaxDiff = -LINF;
    for (int i = 0; i < n; i++) MaxDiff = max(MaxDiff, a[i].d - a[i].h);
    if (x - MaxDmg <= 0)
      cout << 1 << '\n';
    else {
      if (MaxDiff <= 0)
        cout << -1 << '\n';
      else {
        long long tek = x - MaxDmg;
        long long ans = (tek + MaxDiff - 1) / MaxDiff;
        cout << ans + 1 << '\n';
      }
    }
  }
}
