#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
struct node {
  long long x, y, z;
  bool operator<(const node &b) const { return z < b.z; }
} a[MAXN];
long long T, n, x, Max, cnt, ans;
int main() {
  cin >> T;
  while (T--) {
    cin >> n >> x;
    cnt = 0;
    Max = 0;
    memset(a, 0, sizeof a);
    for (int i = 1; i <= n; i++) {
      cin >> a[i].x >> a[i].y;
      a[i].z = a[i].y - a[i].x;
      cnt += (a[i].z < 0);
      Max = max(Max, a[i].x);
    }
    if (Max >= x) {
      cout << 1 << endl;
      continue;
    }
    if (!cnt) {
      cout << -1 << endl;
      continue;
    }
    sort(a + 1, a + n + 1);
    a[1].z = -a[1].z;
    ans = ceil((x - Max) * 1.0 / a[1].z) + 1;
    cout << ans << endl;
  }
  return 0;
}
