#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, x;
    long long a, b, c = 0, d = 0;
    cin >> n >> x;
    for (register int i = 1; i <= n; ++i) {
      cin >> a >> b;
      c = max(c, a);
      d = max(d, a - b);
    }
    x -= c;
    if (x <= 0) {
      cout << 1 << '\n';
    } else if (d <= 0)
      cout << -1 << '\n';
    else {
      cout << (x - 1) / d + 2 << '\n';
    }
  }
  return 0;
}
