#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    vector<pair<int, int> > a;
    int d, h, mm = 0;
    for (int i = 0; i < n; ++i) {
      cin >> d >> h;
      a.push_back({d - h, d});
      mm = max(mm, d);
    }
    sort(a.rbegin(), a.rend());
    int ma = a[0].first, ans = 0;
    x -= mm;
    if (ma < 0 && x > 0) {
      cout << -1 << "\n";
      continue;
    }
    if (ma != 0 && x > 0) {
      ans = (x) / ma + 1;
      if (x % ma) ++ans;
    } else {
      if (x > 0)
        ans = -1;
      else
        ans = 1;
    }
    cout << ans << "\n";
  }
}
