#include <bits/stdc++.h>
using namespace std;
const int Q = (int)1e3 + 3;
const int N = (int)2e5 + 5;
const int mod = (int)1e9 + 7;
const double eps = (double)1e-6;
bool cmp(pair<int, int> a, pair<int, int> b) {
  return a.first - a.second > b.first - b.second;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, x, mx = 0;
    cin >> n >> x;
    vector<pair<int, int> > d(n);
    for (int i = 0; i < n; i++) {
      cin >> d[i].first >> d[i].second;
      mx = max(mx, d[i].first);
    }
    sort(d.begin(), d.end(), cmp);
    int col = 1, w = d[0].first - d[0].second;
    x -= mx;
    if (x <= 0) {
      cout << col << endl;
    } else {
      if (w > 0) {
        col += (x + w - 1) / w;
        cout << col << endl;
      } else {
        cout << -1 << endl;
      }
    }
  }
  return 0;
}
