#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int mx = 0, mx2 = 0;
    while (n--) {
      int d, h;
      cin >> d >> h;
      mx2 = max(mx2, d);
      mx = max(mx, d - h);
    }
    if (mx2 >= x) {
      cout << 1 << '\n';
    } else if (mx <= 0) {
      cout << -1 << '\n';
    } else {
      cout << (x - mx2 - 1) / mx + 2 << '\n';
    }
  }
}
