//#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") //#pragma GCC optimize("unroll-loops") #include #define N 105 #define inf 2147483647 #define LL long long #define DB double using namespace std; int T,n;bool vis[N];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}; //inline int dfs(int x,int s){ // vis[x]=1;if(s==n) return 1;int res=0,a=(x+s)%n;if(!a) a=n;if(!vis[a]) res+=dfs(a,s+1),vis[a]=0; // a=(x-s+n)%n;if(!a) a=n;if(!vis[a]) res+=dfs(a,s+1),vis[a]=0;return res; //} struct FastIO{ static const int S=1048576; char buf[S],*L,*R;int stk[20],Top;~FastIO(){clear();} inline char nc(){return L==R&&(R=(L=buf)+fread(buf,1,S,stdin),L==R)?EOF:*L++;}inline void clear(){fwrite(buf,1,Top,stdout);Top=0;} inline void pc(char ch){Top==S&&(clear(),0);buf[Top++]=ch;}inline void endl(){pc('\n');} FastIO& operator >> (char&ch){while(ch=nc(),ch==' '||ch=='\n');return *this;} templateFastIO& operator >> (T&ret){ ret=0;int f=1;char ch=nc();while(ch<'0'||ch>'9'){if(ch=='-')f=-f;ch=nc();} while(ch>='0'&&ch<='9'){ret=ret*10+ch-'0';ch=nc();}ret*=f;return *this; } FastIO& operator >> (char* s){int Len=0;char ch=nc();while(ch!='\n'){*(s+Len)=ch;Len++;ch=nc();}} templateFastIO& operator << (T x){ if(x<0){pc('-');x=-x;}do{stk[++stk[0]]=x%10;x/=10;}while(x); while(stk[0]) pc('0'+stk[stk[0]--]);return *this; } FastIO& operator << (char ch){pc(ch);return *this;} FastIO& operator << (string str){int Len=str.size()-1;for(stk[0]=0;Len>=0;Len--) stk[++stk[0]]=str[Len];while(stk[0]) pc(stk[stk[0]--]);return *this;} }fin,fout; int main(){ // freopen("data.in","r",stdin); // freopen("jxc.out","w",stdout); // cout<<"ans[85]={";for(register int i=1;i<=79;i++) n=i,cout<>T;while(T--) fin>>n,fout<