1 #include <iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 ios::sync_with_stdio(false); 8 int t; 9 cin >> t; 10 while (t--) 11 { 12 long long n; 13 cin >> n; 14 if (n % 3 == 0) 15 cout << (n / 3)*(n / 3)*(n / 3) << endl; 16 else if (n % 4 == 0) 17 cout << (n / 2)*(n / 4)*(n / 4) << endl; 18 else 19 cout << "-1" << endl; 20 } 21 return 0; 22 }
HDU6298-2018ACM暑假多校联合训练1001-Maximum Multiple
原文:https://www.cnblogs.com/qq965921539/p/9360692.html