#include <bits/stdc++.h>
using namespace std;
long long int n, t, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> n >> m;
    long long int x, y, diff = 0, ans = 0, mx = 0;
    pair<long long int, long long int> p;
    for (int i = 0; i < n; i++) {
      cin >> x >> y;
      if (x >= m) ans = 1;
      mx = max(mx, x);
      if (diff < (x - y)) diff = (x - y), p = {x, y};
    }
    if (ans == 1) {
      cout << 1 << endl;
      continue;
    }
    if (diff == 0) {
      cout << -1 << endl;
      continue;
    }
    x = p.first;
    y = p.second;
    n = (m - mx) / (x - y);
    if (m - mx - n * x + n * y > 0) n++;
    n++;
    cout << n << endl;
  }
}
