#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int q;
  cin >> q;
  while (q--) {
    int n, x;
    cin >> n >> x;
    int forceMax = 0;
    int damageMax = 0;
    while (n--) {
      int d, h;
      cin >> d >> h;
      forceMax = max(forceMax, d);
      damageMax = max(damageMax, d - h);
    }
    if (forceMax >= x) {
      cout << 1 << "\n";
      continue;
    }
    if (damageMax <= 0) {
      cout << -1 << "\n";
      continue;
    }
    int left = x - forceMax;
    cout << 1 + left / damageMax + (left % damageMax ? 1 : 0) << "\n";
  }
}
