#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int blo = 0;
    int mx = 0;
    for (int i = 0; i < n; ++i) {
      int d, h;
      scanf("%d%d", &d, &h);
      mx = max(mx, d);
      blo = max(blo, d - h);
    }
    x -= mx;
    if (x <= 0) {
      cout << 1 << endl;
      continue;
    }
    int ans = 1;
    if (blo == 0 && x > 0) {
      cout << -1 << endl;
      continue;
    }
    ans += x / blo;
    if (x % blo > 0) ans++;
    cout << ans << endl;
  }
}
