#include <bits/stdc++.h>
using namespace std;
int main() {
  long int t;
  cin >> t;
  while (t--) {
    long long n, x, i, j, k, l, maxs;
    cin >> n >> x;
    long long a[n], b[n];
    for (i = 0; i < n; i++) cin >> a[i] >> b[i];
    long long ans = 1e12;
    maxs = *max_element(a, a + n);
    for (i = 0; i < n; i++) {
      if (a[i] >= x) {
        ans = 1;
        break;
      }
      j = (x - maxs);
      k = a[i] - b[i];
      if (k > 0) {
        l = j / k;
        if (j % k != 0) l++;
        j = x - l * (k);
      } else
        continue;
      if (j != 0) l += 1;
      ans = min(ans, l);
    }
    if (ans == 1e12)
      cout << "-1";
    else
      cout << ans;
    cout << endl;
  }
}
