#include<bits/stdc++.h> #define MAX_N 50000 #define mid (l+((r-l)>>1)) usingnamespace std; template <classT> inlinevoidread(T &x){ x = 0; int c = getchar(), f = 1; for (; !isdigit(c); c = getchar()) if (c == 45) f = -1; for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0'); } bool NotPri[MAX_N+5]; int pri[MAX_N+5], mu[MAX_N+5], cnt; voidinit(){ mu[1] = 1; for (int i = 2; i <= MAX_N; i++) { if (!NotPri[i]) pri[cnt++] = i, mu[i] = -1; for (int j = 0; j < cnt; j++) { if (i*pri[j] > MAX_N) break; NotPri[i*pri[j]] = true; if (i%pri[j]) mu[i*pri[j]] = -mu[i]; else {mu[i*pri[j]] = 0; break;} } } } boolchk(int n, int k){ int rk = 0; for (int i = (int)sqrt(n); i; i--) rk += mu[i]*(n/i/i); return rk >= k; } voidsol(int k){ int l = 1, r = 2*k, ans = -1; while (l <= r) if (!chk(mid, k)) l = mid+1; else ans = mid, r = mid-1; printf("%d\n", ans); } intmain(){ int T, k; read(T), init(); while (T--) read(k), sol(k); return0; }