#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l = 0, n, m;
  cin >> n;
  while (n--) {
    long long int t, x;
    cin >> t >> x;
    long long int d[t], h[t];
    long long int max1 = 0, min1 = 100000000000;
    for (int i = 0; i < t; i++) {
      cin >> d[i] >> h[i];
      max1 = max(d[i], max1);
      min1 = min(min1, h[i] - d[i]);
    }
    i = 0;
    long long int ct = 1;
    if (min1 >= 0) {
      if (max1 >= x)
        cout << "1";
      else
        cout << "-1";
    } else {
      if (max1 >= x)
        cout << "1";
      else {
        min1 = -min1;
        cout << (x - max1) / min1 + ((x - max1) % min1 != 0) + 1;
      }
    }
    cout << "\n";
  }
}
