#include <bits/stdc++.h>
using namespace std;
int n, x, t;
int d[110], h[110];
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> x;
    bool flag_desc = false;
    int m = 0;
    int midx = 0, mdes = 0;
    for (int i = 0; i < n; i++) {
      cin >> d[i] >> h[i];
      if (d[i] - h[i] > mdes) {
        flag_desc = true;
        mdes = d[i] - h[i];
        midx = i;
      }
      m = max(m, d[i]);
    }
    if (m >= x) {
      cout << 1 << endl;
      continue;
    }
    if (!flag_desc) {
      cout << -1 << endl;
      continue;
    }
    int ans = (x - m) / mdes + 1;
    if ((x - m) % mdes) ans++;
    cout << ans << endl;
  }
}
