#include #include #include #define il __inline__ __attribute__((always_inline)) #define cs const #define mod 1000000007 using namespace std; typedef long long ll; typedef cs int& ci; #define max_n 2000000 int h[max_n+1]; void write(ci x){ if(x>=10){ write(x/10); putchar(x%10|'0'); } else putchar(x|'0'); } il void writeln(ci x){ write(x); putchar('\n'); } il void test(){ int n,x,y; scanf("%d%d%d",&n,&x,&y); if(x==y){ puts("0"); return; } if(x>y) x=n-x+1,y=n-y+1; ll u=((ll(y-x)*((ll(n)*h[n]-ll(n-y)*h[n-y+1]-ll(y)*h[y])%mod)+ll(n-x+1)*(h[n-x+1]-h[n-y+1]))%mod+mod)%mod; ++x; ll v=(x==y)?0:(((ll(y-x)*((ll(n)*h[n]-ll(n-y)*h[n-y+1]-ll(y)*h[y])%mod)+ll(n-x+1)*(h[n-x+1]-h[n-y+1]))%mod+mod)%mod); writeln((u-v+mod)%mod); } il void init(ci n){ h[1]=1; for(int i=2; i<=n; ++i) h[i]=ll(mod-mod/i)*h[mod%i]%mod; for(int i=2; i<=n; ++i) h[i]=(h[i]+h[i-1])%mod; } int main(){ int t; for(scanf("%d",&t),init(max_n); t; --t,test()); return 0; }