#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  for (int j = 0; j < t; j++) {
    int n, x;
    cin >> n >> x;
    int d[n];
    int h[n];
    int maxd = -1;
    long long maxdh = -1000000000000;
    for (int i = 0; i < n; i++) {
      cin >> d[i] >> h[i];
      if (d[i] > maxd) {
        maxd = d[i];
      }
      if (d[i] - h[i] > maxdh) {
        maxdh = d[i] - h[i];
      }
    }
    if (x <= maxd) {
      cout << 1 << "\n";
    } else if (maxdh <= 0) {
      cout << -1 << "\n";
    } else if (x > maxd && maxdh > 0) {
      double h = (double)(x - maxd) / maxdh;
      int ans = ceil(h);
      ans++;
      cout << ans << "\n";
    }
  }
  return 0;
}
