#include<iostream>
#include<cstdio>
#define M 200010
using namespace std;
int n,l,r,ans,T,h[M],inv[M];
const int mod=1e9+7;
int power(int a,int b) {
	int ans=1;
	while(b) {
		if(b&1) ans=1ll*ans*a%mod;
		b>>=1; a=1ll*a*a%mod;
	}
	return ans;
}
int C(int n,int m) {
	return 1ll*h[n]*inv[m]%mod*inv[n-m]%mod;
}
int In(int x,int l,int r) {
	return (l>=x)+(r>=x);
}
int main() {
	h[0]=inv[0]=1;
	for(int i=1;i<=200000;i++) 
		h[i]=1ll*i*h[i-1]%mod,inv[i]=power(h[i],mod-2);
	scanf("%d",&T);
	while(T--) {
		scanf("%d%d%d",&n,&l,&r);
		int x=min(r-n,1-l);
		ans=1ll*x*C(n,n/2)%mod;
		if(n&1) ans=2ll*ans%mod;
		int h=1,t=n,l1=0,l2=0;
		for(int i=x+1;;i++) {
			int mid=(n+1)/2;
			if(n&1) {
				while(h<=mid&&In(i,r-h,h-l)==1) 
					h++,l1++;
				while(t>=mid&&In(i,r-t,t-l)==1) 
					t--,l2++;
				if(!In(i,r-h,h-l)||!In(i,r-t,t-l))
					break;
			}
			else {
				while(h<=mid&&In(i,r-h,h-l)==1) 
					h++,l1++;
				while(t>mid&&In(i,r-t,t-l)==1) 
					t--,l2++;	
			}
			if(l1>mid||l2>mid) break;
			if(n&1) {
				if(l1==mid||l2==mid) ans=(ans+1)%mod;
				else ans=((ans+C(n-l1-l2,mid-l1))%mod+C(n-l1-l2,mid-l2))%mod;
			}
			else ans=(ans+C(n-l1-l2,mid-l1)%mod)%mod;
			if(l1==mid||l2==mid) break;
		}
		printf("%d\n",ans);
	}
	return 0;
}