#include <bits/stdc++.h>
using namespace std;
string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int m, x;
    cin >> m >> x;
    int maxba = 0, maxa = 0;
    while (m--) {
      int a, b;
      cin >> a >> b;
      maxa = max(maxa, a);
      maxba = max(maxba, a - b);
    }
    if (maxa >= x)
      cout << "1" << endl;
    else if (maxba == 0)
      cout << "-1" << endl;
    else {
      int ans = (x - maxa + maxba - 1) / maxba;
      cout << ans + 1 << endl;
    }
  }
}
