#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int T;
int n, x;
int main() {
  cin >> T;
  while (T--) {
    cin >> n >> x;
    int maxd = 0, maxhit = 0;
    for (int i = 0; i < n; i++) {
      int d, h;
      cin >> d >> h;
      maxd = max(maxd, d);
      maxhit = max(maxhit, d - h);
    }
    if (maxd < x && maxhit <= 0)
      puts("-1");
    else if (maxd >= x)
      puts("1");
    else {
      int tokill = x - maxd;
      int res = tokill / maxhit + (tokill % maxhit ? 1 : 0) + 1;
      cout << res << endl;
    }
  }
  return 0;
}
