#include using namespace std; using ll = long long; #ifdef LOCAL #include "debug.hpp" #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) #endif ll K; vector primes; void calc_init() { vector check(100, 1); for (ll i = 2; i < 100; i++) { if (check[i]) { primes.push_back(i); for (ll j = 2; i * j < 100; j++) { check[i * j] = 0; } } } } bool isOK(ll key) { ll max = sqrt(key); ll cnt = 1; for (ll p: primes) { double temp = pow(key, 1.0 / ((double) p)); ll temp2 = (ll) temp; if (pow(temp2 + 1, p) <= key) temp2++; if (temp2 <= 1) break; cnt += (temp2 - 1); } return (cnt >= K); } int main() { ios::sync_with_stdio(false); cin.tie(0); calc_init(); debug(primes); ll T; cin >> T; for (ll t = 0; t < T; t++) { cin >> K; // N以下の累乗数はK個以下? ll ok = 2e18, ng = 0; while (abs(ok - ng) > 1) { ll mid = (ok + ng) / 2; if (isOK(mid)) ok = mid; else ng = mid; } cout << ok << '\n'; } return 0; }