#include <bits/stdc++.h>
using namespace std;
const int N = 500023;
bool vis[N];
vector<int> adj[N];
void solve() {
  long long int n, x;
  cin >> n >> x;
  long long int maxi = 0;
  long long int maxdiff = INT_MIN;
  for (int i = 0; i < n; i++) {
    long long int a, b;
    cin >> a >> b;
    if (a > maxi) maxi = a;
    long long int diff = a - b;
    if (diff > maxdiff) maxdiff = diff;
  }
  if (maxi >= x) {
    cout << 1 << '\n';
    return;
  } else {
    if (maxdiff <= 0) {
      cout << "-1\n";
    } else {
      long long int temp = 0;
      temp = (x - maxi) / maxdiff;
      if (x - (temp * maxdiff) <= 0) {
        cout << temp << '\n';
      } else {
        if (x - (temp * maxdiff) <= maxi)
          cout << temp + 1 << '\n';
        else {
          temp++;
          if (x - (temp * maxdiff) <= 0)
            cout << temp << '\n';
          else if (x - (temp * maxdiff) <= maxi)
            cout << temp + 1 << '\n';
        }
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  cin >> T;
  int t = 0;
  while (t++ < T) {
    solve();
  }
}
