#include <iostream>
#include <cstdio>
#include <queue>
#include <math.h>
#include <stack>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 7;
const int mod=1e9+7;
ll  a1[maxn],b1[maxn];
ll quickpow(ll a ,ll b){
   ll ans=1;
   while(b>0){
         if(b&1) ans=ans*a%mod;
         a=a*a%mod;
         b>>=1;
   }
   return ans;
}
ll ni(ll x){
    return quickpow(x,mod-2);
}
void init (){
     a1[0]=1;
     for(int i=1;i<maxn;i++){
        a1[i]=(a1[i-1]*i)%mod;
     }
     b1[maxn-1]=ni(a1[maxn-1]);
     for(int i=maxn-2;i>=0;i--){
         b1[i]=b1[i+1]*(i+1)%mod;
     }
}
ll c(ll n,ll m){
    return (a1[n]*b1[m]%mod)*b1[n-m]%mod;
}
int T;
int n , l , r;
int main(){
    scanf("%d",&T);
    init();
    while(T--){
         scanf("%d%d%d",&n,&l,&r);
         ll ans = 0;

         int x = min(r - n , 1 - l);
         if(n%2==0){
            ans = c(n , n / 2) * 1ll * x % mod;
         }else{
            ans = 2*c(n , n / 2) * 1ll * x % mod;
         }
//         printf ("%d %lld\n",x,ans);

         for(int i = x + 1; i <= r; i ++){
            int R = r - i;
            int L = l + i;

            int cnt1 = max(0 , n - R); // 必须·加
            int cnt2 = max(0 , L - 1);




            if(n % 2 == 0){
                if(cnt1 > n / 2 || cnt2 > n / 2) break;
                ans = (ans + c(n - cnt1 - cnt2 , n / 2 - cnt1)) % mod;
            }
            else{
                if(cnt1 > n / 2 + 1 || cnt2 > n / 2 + 1) break;

                ans = (ans + c(n - cnt1 - cnt2 , n / 2 - cnt1)) % mod;
                ans = (ans + c(n - cnt1 - cnt2 , n / 2 + 1 - cnt1)) % mod;


            }

         }
         printf ("%lld\n",ans);



    }

}
