标签:return type cstring maximum ace can color tin mes
思路:多写几个数会发现,只有n%3==0和n%4==0的情况下满足题意。
#include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; typedef long long ll; int main(void) { ll n; ll t; scanf("%lld",&t); while(t--) { scanf("%lld",&n); if(n<3) printf("-1\n"); else { if(n%3==0) { printf("%lld\n",n/3*n/3*n/3); continue; } if(n%4==0) { printf("%lld\n",n/4*n/4*n/2); } else printf("-1\n"); } } return 0; }
标签:return type cstring maximum ace can color tin mes
原文地址:https://www.cnblogs.com/AC-AC/p/9739663.html