// Author: Damian Straszak #include using namespace std; int n; bool good(int x) { if (x==1) return 0; if ((2*n)%x) return 0; int y=2*n/x; if (y%2==x%2) return 0; return 1; } int main() { ios_base::sync_with_stdio(0); int test; cin>>test; while(test--) { cin>>n; int L=n+1; for(int x=1;x*x<=2*n;x++) { if (good(x)) { L=x; break; } } if (L<=n) { int K=(2*n/L-L+1)/2; cout<