#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int j = 0; j < t; j++) {
    int n, x;
    cin >> n >> x;
    int max1 = 0, max2 = 0;
    for (int k = 0; k < n; k++) {
      int z, f;
      cin >> z >> f;
      max1 = max(max1, z);
      max2 = max(max2, z - f);
    }
    int kol = 1;
    x -= max1;
    x = max(x, 0);
    if (x == 0)
      cout << kol;
    else {
      if (max2 == 0)
        cout << -1;
      else
        cout << kol + (x / max2) + (bool)(x % max2);
    }
    cout << endl;
  }
}
