#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int max1 = INT_MIN, max2 = INT_MIN;
    int d[n], h[n];
    for (int i = 0; i < n; i++) {
      cin >> d[i] >> h[i];
    }
    for (int i = 0; i < n; i++) {
      max1 = max(max1, d[i] - h[i]);
      max2 = max(max2, d[i]);
    }
    if (max2 >= x) {
      cout << "1\n";
    } else if (max1 <= 0) {
      cout << "-1"
           << "\n";
    } else {
      x = x - max2;
      int p = (x / max1) + 1;
      int q = (x / max1) + 2;
      if (x % max1 == 0) {
        cout << p << "\n";
      } else
        cout << q << "\n";
    }
  }
}
