简略题意:每次给出一个质数,问这个质数是不是两个立方数的差。
直接模拟即可。
#define others
#ifdef poj
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#endif // poj
#ifdef others
#include <bits/stdc++.h>
#endif // others
//#define file
#define all(x) x.begin(), x.end()
using namespace std;
const double eps = 1e-8;
int dcmp(double x) { if(fabs(x)<=eps) return 0; return (x>0)?1:-1;};
typedef long long LL;
namespace solver {
const int maxn = 100011;
int t;
void solve() {
scanf("%d", &t);
LL n;
while(t--) {
scanf("%lld", &n);
LL i;
for(i = 1; ; i++) {
if(i*i*i-(i-1)*(i-1)*(i-1) >= n) break;
}
if(i*i*i-(i-1)*(i-1)*(i-1) == n) puts("YES");
else puts("NO");
}
}
}
int main() {
solver::solve();
return 0;
}