思路:
找规律。
代码:
#include<bits/stdc++.h>
using namespace std;
int T;
int main() {
scanf("%d",&T);
while(T--) {
int x;
scanf("%d",&x);
if(x%3==0) printf("%lld\n",((long long)x/3)*(x/3)*(x/3));
else if(x%4==0) printf("%lld\n",((long long)x/2)*(x/4)*(x/4));
else printf("-1\n");
}
return 0;
}