#include #define rep(i, n) for(int i = 0; i < (int)(n); i ++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i ++) #define MP make_pair using namespace std; typedef long long LL; typedef pair PII; const int MOD = 998244353; int n; bool occ[105]; int calc(int pos, int d) { if(d == n) return 1; int np = (pos + d) % n, ret = 0; if(!occ[np]) { occ[np] = true; ret += calc(np, d + 1); occ[np] = false; } np = (pos - d + n) % n; if(!occ[np]) { occ[np] = true; ret += calc(np, d + 1); occ[np] = false; } return ret; } void solve() { memset(occ, 0, sizeof(occ)); occ[0] = true; printf("%d, ", calc(0, 1)); } int ans[85] = {0, 1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 6, 8, 2, 8, 6, 16, 2, 4, 6, 8, 4, 12, 6, 16, 4, 4, 4, 16, 2, 12, 10, 32, 4, 4, 8, 8, 2, 12, 6, 16, 2, 8, 6, 24, 6, 12, 8, 32, 6, 8, 6, 8, 2, 8, 10, 32, 4, 4, 6, 24, 2, 20, 6, 64, 6, 8, 8, 8, 4, 16, 6, 16, 2, 4, 8, 24, 14, 12, 6, 32}; int main() { int T; scanf("%d", &T); while(T --) { scanf("%d", &n); printf("%d\n", ans[n]); } return 0; occ[0] = true; for(n = 1; n < 81; n ++) solve(); return 0; }