#include <bits/stdc++.h>
using namespace std;
const int NASA = 1e5;
int main() {
  long long t, a, b, c, maxi = -1e9, maxkill = -1e9, ru, ro;
  cin >> t;
  for (int u = 0; u < t; u++) {
    cin >> a >> b;
    maxkill = -1e9, maxi = -1e9;
    for (int i = 0; i < a; i++) {
      cin >> ru >> ro;
      if (ru > maxkill) {
        maxkill = ru;
      }
      if (ru - ro > maxi) {
        maxi = ru - ro;
      }
    }
    if (maxi <= 0) {
      if (maxkill >= b) {
        cout << 1;
      } else {
        cout << -1;
      }
    } else if (maxkill >= b) {
      cout << 1;
    } else {
      int ans = (b - maxkill) / maxi;
      if ((b - maxkill) % maxi > 0) {
        ans++;
      }
      cout << ans + 1;
    }
    cout << '\n';
  }
  return 0;
}
