#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll my_sqrt(ll x){
	ll low = 0, high = 2e9, ans = 0;
	while(low <= high){
		ll mid = (low + high) / 2;
		if(mid * mid <= x){
			ans = mid;
			low = mid + 1;
		}
		else high = mid - 1;
	}
	return ans;
}

void s(){
	ll k; cin >> k;
	ll low = 0, high = 2e18, ans = 0;
	while(low <= high){
		ll mid = (low + high) / 2;
		ll cur = mid - my_sqrt(mid);
		if(cur < k){
			low = mid + 1;
		}
		if(cur == k){
			ans = mid;
			high = mid - 1;
		}
		if(cur > k){
			high = mid - 1;
		}
	}
	cout << ans << endl;
}

int main(){
	int t; cin >> t; while(t --) s();
}
