题意:x+y+z = n , n%x=0,n%y=0,n%z=0,求x*y*z 的最大值
题解:
ac code:
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int t; scanf("%d",&t); while(t--) { ll n; scanf("%lld",&n); n = n*n*n; if(n%27 == 0) printf("%lld\n",n/27); else if(n%32 == 0) printf("%lld\n",n/32); else if(n%36 == 0) printf("%lld\n",n/36); else printf("-1\n"); } re
原文地址:https://www.cnblogs.com/lemon-jade/p/9356815.html
时间: 2024-11-08 00:58:43