#include #define MOD (1000000007) long long int c,m ,fact[1000010]; int H(int n, int r){ c = (fact[n+r-1])%MOD; m = (fact[r]%MOD * fact[n-1]%MOD)%MOD; return (int)((c/m)%MOD); } int P(int n, int r){ if(r>n){ return 0;} c = fact[n]%MOD; m = fact[n-r]%MOD; return (int)((c/m)%MOD); } int C(int n, int r){ if(r>n){ return 0; } c = P(n,r); m = fact[r]%MOD; return (int)((c/m)%MOD); } int main(void){ int i,T; int ans[100010]; fact[0] = 1; for(i=1;i<=1000000;i++){ fact[i] = ((fact[i-1]%MOD)*(i%MOD))%MOD; } scanf("%d", &T); for(i=0;i