#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, x;
    cin >> n >> x;
    long long int max1 = -1;
    long long int maxd = -1;
    for (long long int i = 0; i < n; i++) {
      long long int d, h;
      cin >> d >> h;
      if (d > maxd) {
        maxd = d;
      }
      if ((d - h) > max1) {
        max1 = (d - h);
      }
    }
    if (maxd >= x) {
      cout << 1 << "\n";
      continue;
    }
    if (max1 <= 0) {
      cout << -1 << "\n";
      continue;
    }
    long long int cal = x - maxd;
    long long int cal2 = ceil((cal * 1.0) / max1);
    cout << cal2 + 1 << "\n";
  }
}
