#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define countSetBits(x) __builtin_popcountll(x)
#define trailz(x) __builtinctzll(x)
#define leadz(x) __builtinclzll(x)
#define endl          '\n'
#define integer       int
#define int           long long
#define vec           vector
#define fo(i,b)       for(int i=0;i<b;i++)
#define Fo(i,k,n)     for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define debug(args...) cerr << "["#args"] = ["; dbg,args; cerr << "]" << endl;
struct debugger {
  template<typename T> debugger& operator , (const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
#define bug(arr,a) { Fo(i,0,a) cerr<<arr[i]<<" "; cerr<<endl; }
void kick2309()
{    
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #ifndef ONLINE_JUDGE
    freopen("error.txt", "w", stderr);
  #endif
}
void solve()
{ 
   int a,b,c,d;
   cin>>a>>b>>c>>d;
   //a - cyan balls + b- cyan balls +c - red ball 
   // target - a+b crose d*c
   int cyan=a;
   int red=0;
   int ans = 0;
   while(1){
    cyan+=b;
    red+=c;
    ans++;
    if(red*d>=cyan) break;
    else{
      if(d*c<=b) {
        cout<<-1<<endl;
        return;
      }
    }
   }
   cout<<ans<<endl;

  }
int32_t main()
{   
  kick2309();
  int t = 1;
  //cin >> t;
  while (t--)
  {
    solve();
  }
#ifndef ONLINE_JUDGE
  cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
#endif
  return 0;
}
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define REP(i, start, end) for (ll i = start, i##Len = (end); i < i##Len; ++i)
#define REPR(i, start, end) for (ll i = start, i##Len = (end); i > i##Len; --i)
using ll = long long;
using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    int t;
    cin >> t;
    const ll mod = 1e9 + 7;

    REP(_, 0, t)
    {
        ll n, a, b;
        cin >> n >> a >> b;
        if (n - a - b < 0)
        {
            cout << 0 << "\n";
            continue;
        }
        ll comb_a = (n - a + 1) * (n - a + 1) % mod;
        ll comb_b = (n - b + 1) * (n - b + 1) % mod;
        ll comb = comb_a * comb_b % mod;
        ll sub = ((n - a + 1) * (n - b + 1) - (n - a - b + 2) * (n - a - b + 1)) % mod;
        sub = sub * sub % mod;
        cout << (comb - sub + mod) % mod << "\n";
    }
}