#include <bits/stdc++.h>
long long int mod = 1000000007;
using namespace std;
bool comp(pair<int, pair<int, int>> A, pair<int, pair<int, int>> B) {
  return A.first > B.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    pair<int, pair<int, int>> pi[n];
    int maxx = -1;
    for (int i = 0; i < n; ++i) {
      cin >> pi[i].second.first >> pi[i].second.second;
      pi[i].first = pi[i].second.first - pi[i].second.second;
      maxx = max(pi[i].second.first, maxx);
    }
    sort(pi, pi + n, comp);
    if (x <= maxx) {
      cout << "1\n";
      continue;
    }
    if (pi[0].first <= 0) {
      cout << "-1\n";
      continue;
    }
    x -= maxx;
    long double ans1 = (x * 1.0) / (pi[0].first * 1.0);
    int ans = ceil(ans1);
    cout << ans + 1 << "\n";
  }
  return 0;
}
