func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2 )   #pragma GCC optimize( unroll-loops )   #define rep(i,a,b) for(int i=(a);i<=(b);++i)   #define req(i,a,b) for(int i=(a);i>=(b);--i)   #define rep_(i,a,b) for(int i=(a);i<(b).size();++i)   #define F(a) rep(a,1,n)   #define M(a,b) memset(a,b,sizeof a)   #define DC int T;cin>>T;while(T--)   #define ll long long   #define Z(a,b) sort(a+1,a+b+1)   using namespace std;   const unsigned _mod=998244353;   const unsigned mod=1e9+7;   const ll infi=0x3f3f3f3f3f3f3fll;   const int inf=0x3f3f3f3f;   void rd(ll &x){x=0;int f=1;char ch=getchar();while(ch<48||ch>57){if(ch==45)f=-1;ch=getchar();}while(ch>=48&&ch<=57)x=x*10+ch-48,ch=getchar();x*=f;}   ll ksm(ll x,ll y=mod-2,ll m=mod){ll ret=1;while(y){if(y&1)ret=ret*x%m;y>>=1ll;x=x*x%m;}return ret;}   ll qpow(ll x,ll y=2){ll ret=1;while(y>0){if(y&1ll)ret=ret*x;y>>=1ll;x=x*x;}return ret;}   /*       [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]       [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]       [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]   */   ll fac[1000010],inv[1000010];   ll C(ll n,ll m){if(m>n||m<0)return 0;return fac[n]*inv[m]%mod*inv[n-m]%mod;}   int n,l,r,ans;   int chk(int x)   {       if (x<=0) return 0;       int a=max(x+l-1,0),b=max(n-r+x,0);       if (a+b>n) return 0;       if (n&1) return C(n-a-b,n/2-a)+C(n-a-b,n/2-a+1);       return C(n-a-b,n/2-a);   }   int chk2()   {       if (n&1) return C(n,n/2)+C(n,n/2+1);       return C(n,n/2);   }   int main()   {       *fac=*inv=1;       rep(i,1,1000000) fac[i]=fac[i-1]*i%mod;       rep(i,1,1000000) inv[i]=ksm(fac[i]);    DC       {           ans=0;           cin>>n>>l>>r;           rep(i,min(-l,r-n),min(n-l,r)) (ans+=chk(i))%=mod;           (ans+=1ll*max(min(-l,r-n)-1,0)*chk2()%mod)%=mod;           cout<<ans<<  n ;       }    return 0;   }