#include <bits/stdc++.h>
using namespace std;
int k = 0, q = 0;
int main() {
  int n;
  cin >> n;
  int m, x;
  int a, b;
  while (n--) {
    cin >> m >> x;
    k = 0;
    q = 0;
    while (m--) {
      cin >> a >> b;
      q = max(q, a);
      k = max(k, a - b);
    }
    if (q >= x)
      cout << 1 << '\n';
    else if (k == 0)
      cout << -1 << '\n';
    else
      cout << (x - q + k - 1) / k + 1 << '\n';
  }
}
