#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
#define pii pair<int,int>
#define pll pair<long long,long long>
 
#define fi first
#define se second
 
#define pb push_back
#define sz(x) ((int) (x).size())
#define rep(i,n) for (int i=1;i <=int(n);i++)
#define rrep(i,n) for (int i=int(n);i >= 1 ;i--)
#define ffor(i,n) for (int i=0;i <int(n);i++)
#define rfor(i,n) for (int i=int(n-1);i >= 0;i--)
#define all(x) x.begin(),x.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
 
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); // use rng() for random

ll a[300005];
const ll mod = 1000000007;
ll l[200005],r[200005];
ll fac[200005];
ll add(ll& a, ll b) {a += b;  if (a >= mod)  a -= mod;  return a; }
ll sub(ll& a, ll b) {a -= b;   if (a < 0)    a += mod;  return a; }
ll mul(ll& a, ll b) {  ll c = ll(a) * b;if (c >= mod)  c %= mod;  a = c;   return a;}

ll bpow(ll a, ll n) {
     ll ans = 1;  a%=mod;
     while (n) {
          if (n & 1)  mul(ans, a);
          n >>= 1;    mul(a, a);
     }
     return ans;
}
ll inv(ll a){  return bpow(a,mod-2);}
ll choose(ll n , ll k){
     if ( k < 0 || k > n ) return 0;
     ll res = fac[n] ;
     res = res * inv(fac[k]); res %= mod;
     res = res * inv(fac[n-k]);res %= mod;
     return res;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    fac[0] =1;
    rep(i,200000){
        fac[i] = (fac[i-1] * i ) % mod;
    }
    int t; cin >> t;
    while (t--){
        int n; ll a ,b; cin >> n >> a >> b;
       
        rep(i,n) {
            l[i] = a-i;
            r[i] = b-i;
        }
      
        if ( n % 2 == 0){
            ll ans = 0;
            ll need = n/2;
            ll val = choose(n,n/2);
            
            int ind1 = n/2 ;int ind2 = ind1 +1;
            ll maxval = min(-l[ind2],r[ind1]);
            if (maxval <= 0){
                cout << 0 << '\n'; continue;
            }
       
            int cntup = 0, cntdown = 0;
            rep(i,n) if (r[i] >= maxval) cntup++;
            rep(i,n) if (l[i] <= -maxval) cntdown++;
          
                  
           
            while (true){
          
                ll giao = cntup+cntdown - n;
                
       
                 ll numup = cntup - giao;
                 ll numdown = cntdown -giao;
                 ll numgiao =  n - numup- numdown;
                
                 add(ans,choose(numgiao,need-numup));
                
                cntup = min(n,cntup+1);
                cntdown  = min(n,cntdown+1);
                  maxval--;
                if (cntup + cntdown == 2*n) break;
              
                if (maxval <= 0) break;
                
                
                
                
            }
            ll left = maxval;
            add(ans,mul(val,left));
        
            cout << ans << '\n';
         
            
            
            
            
            
            
            
        }
        if (n % 2 == 1){
            ll ans = 0;
            ll need = n/2; ll need2 = n/2+1;
            ll val = choose(n,n/2); ll val2 = choose(n,n/2+1);
                       
           int ind1 = n/2 ;int ind2 = ind1 +1;
           ll maxval = min(-l[ind2],r[ind1]);
            
             ind1 = n/2+1 ; ind2 = ind1 +1;
        maxval = max(maxval, min(-l[ind2],r[ind1]));
           if (maxval <= 0){
               cout << 0 << '\n'; continue;
           }
      
           int cntup = 0, cntdown = 0;
           rep(i,n) if (r[i] >= maxval) cntup++;
           rep(i,n) if (l[i] <= -maxval) cntdown++;
         
                 
          
           while (true){
         
               ll giao = cntup+cntdown - n;
               
      
                ll numup = cntup - giao;
                ll numdown = cntdown -giao;
                ll numgiao =  n - numup- numdown;
               
                add(ans,choose(numgiao,need-numup));
                add(ans,choose(numgiao,need2-numup));
               
               cntup = min(n,cntup+1);
               cntdown  = min(n,cntdown+1);
                 maxval--;
               if (cntup + cntdown == 2*n) break;
             
               if (maxval <= 0) break;
               
               
               
               
           }
           ll left = maxval;
           add(ans,mul(val,left));
            add(ans,mul(val2,left));
       
           cout << ans << '\n';
                    
        }
        
   
    }
    
     return 0;
}

