#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  while (b != 0) {
    long long c = a % b;
    a = b;
    b = c;
  }
  return a < 0 ? -a : a;
}
inline long long lowbit(long long x) { return x & (-x); }
const double PI = 3.14159265358979323846;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long mod = 998244353;
inline long long rd() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const double eps = 1e-6;
const int M = 1e6 + 10;
const int N = 1e3 + 10;
int main() {
  int T = rd();
  while (T--) {
    int n = rd(), x = rd();
    int ans = -1;
    int m1 = -1, m2 = -1;
    for (int i = 1; i <= n; i++) {
      int d = rd(), h = rd();
      m1 = max(m1, d);
      m2 = max(m2, d - h);
    }
    if (m1 >= x)
      ans = 1;
    else if (m2 <= 0) {
    } else {
      ans = (x - m1) / m2 + 1;
      if ((x - m1) % m2) ans++;
    }
    cout << ans << endl;
  }
}
