#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, x;
    cin >> n >> x;
    pair<long long int, long long int> arr[n];
    for (long long int i = 0; i < n; i++) cin >> arr[i].first >> arr[i].second;
    long long int hits = INT_MIN, diff = INT_MIN, temp;
    long long int hitsmax = INT_MIN;
    bool flag = true;
    for (long long int i = 0; i < n; i++) {
      long long int val = arr[i].first;
      if (val >= x) {
        flag = false;
        break;
      }
      if (val > hitsmax) hitsmax = val;
      temp = arr[i].first - arr[i].second;
      if (temp > diff) {
        diff = temp;
        hits = arr[i].first;
      }
    }
    if (flag == false) {
      cout << 1 << "\n";
      continue;
    }
    if (diff <= 0) {
      cout << -1 << "\n";
      continue;
    }
    long long int val = (x - hitsmax) / diff + 1;
    long long int temp1 = x;
    for (long long int i = val - 4; i <= val + 4; i++) {
      temp1 = x;
      temp1 -= ((max(0LL, (i - 1))) * diff);
      temp1 -= hitsmax;
      if (temp1 <= 0) {
        cout << i << "\n";
        break;
      }
    }
  }
  return 0;
}
