#include <bits/stdc++.h>
using namespace std;
const char el = '\n';
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  cin.ignore();
  for (int t = 0; t < T; ++t) {
    int n;
    long long c;
    cin >> n >> c;
    long long d, h;
    long long maxdamage = 0;
    long long maxnetdamage = -1000000000;
    for (int i = 0; i < n; ++i) {
      cin >> d >> h;
      maxdamage = max(d, maxdamage);
      maxnetdamage = max(d - h, maxnetdamage);
    }
    if (c > maxdamage && maxnetdamage <= 0) {
      cout << -1 << el;
      continue;
    }
    if (c <= maxdamage) {
      cout << 1 << el;
      continue;
    }
    long long netdamagepairs =
        (c - maxdamage + maxnetdamage - 1) / maxnetdamage;
    cout << netdamagepairs + 1 << el;
  }
}
