#include "bits/stdc++.h"
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define nln "\n"
typedef long long ll;
const int PRIME = 1e9 + 7;
const int M = 1e9 + 7;
const int N = 2e5 + 10;
ll pw(ll a, ll p = M-2, ll MOD = M){
	ll result = 1;
	while (p > 0) {
		if (p & 1)
			result = a * result % MOD;
		a = a * a % MOD;
		p >>= 1;
	}
	return result;
}
ll fact[N], invfact[N];
void init() {
	int p = PRIME;
	fact[0] = 1;
	ll i;
	for(i = 1; i < N; i++) {
		fact[i] = (i * fact[i - 1]) % p;
	}
	i--;
	invfact[i] = pw(fact[i], p-2, p);
	for(i--; i >= 0; i--) {
		invfact[i] = invfact[i + 1] * (i + 1) % p;
	}
}
int ncr(int n, int r){
	if(r > n || n < 0 || r < 0) return 0;
	return fact[n] * invfact[r] % PRIME * invfact[n-r] % PRIME;
}


int main() {
    fastio();
    #ifndef ONLINE_JUDGE
    freopen("error.err", "w", stderr);
    #endif
    init();
    int t, n, l, r;
    cin >> t;
    while(t--) {
    	cin >> n >> l >> r;
    	ll ans = ncr(n, n / 2) * 1LL * min(r - n, 1 - l);
    	ans %= M;
    	if(n % 2) {
    		ans += ncr(n, n / 2) * 1LL * min(r - n, 1 - l);
    		ans %= M;
    	}
    	log(ans);
    	int pos, neg, both, o;
    	for(int i = 0; i < n; i++) {
    		o = min(r - n, 1 - l) + i + 1;
    		pos = min(n, r - o);
    		neg = min(n + 1 - (l + o), n);
    		if(pos < 0 || neg < 0) break;
    		both = n - (n - pos) - (n - neg);
    		pos -= both;
    		neg -= both;
    		if(n % 2) {
    			ans += ncr(both, n/2 - pos);
    			ans %= M;
    			ans += ncr(both, n/2 - neg);
    			ans %= M;
    		} else {
    			ans += ncr(both, n/2 - pos);
    			ans %= M;
    		}
    	}
    	cout << ans << "\n";
    }
    return 0;
}