#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, m;
    cin >> n >> m;
    int max1 = 0, max2 = 0;
    for (int i = 1; i <= n; i++) {
      int x, y;
      cin >> x >> y;
      max1 = max(max1, x);
      max2 = max(max2, x - y);
    }
    if (max2 <= 0 && max1 < m) {
      cout << -1 << endl;
    } else {
      if (max1 >= m) {
        cout << 1 << endl;
      } else {
        m -= max1;
        cout << ((m + max2 - 1) / max2 + 1) << endl;
      }
    }
  }
}
