#include #include #include using namespace std; typedef long long LL; const LL mod = 1e8 + 7; const int maxn = 1010; int n; int G[maxn][maxn]; LL d[2][maxn]; int gcd(int a,int b) { return !b?a:gcd(b,a%b); } void init() { for(int i=1;i<=1000;++i) { for(int j=1;j<=i;++j) G[i][j] = gcd(i,j); } } int main() { //freopen("test.txt","r",stdin); init(); int T; scanf("%d",&T); while(T--) { int cur = 0; scanf("%d",&n); memset(d,0,sizeof d); for(int i=0;i