#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int tmp = 0, max = -1000000005, maxd = 0;
    int data[105][2];
    for (int i = 0; i < n; i++) {
      cin >> data[i][0] >> data[i][1];
      if (data[i][0] >= x) tmp = 1;
      if (max < data[i][0] - data[i][1] && tmp != 1)
        max = data[i][0] - data[i][1];
      if (maxd < data[i][0] && tmp != 1) maxd = data[i][0];
    }
    if (tmp == 1) {
      cout << 1 << endl;
    } else if (max <= 0) {
      cout << -1 << endl;
    } else {
      x -= maxd;
      if (x % max == 0)
        cout << (x / max) + 1 << endl;
      else
        cout << (x / max) + 2 << endl;
    }
  }
}
