2018杭电多校第一场(A)

题意: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/27);
        else if(n%32 == 0)
            printf("%lld
",n/32);
        else if(n%36 == 0)
            printf("%lld
",n/36);
        else
            printf("-1
");
    }
    re
原文地址:https://www.cnblogs.com/lemon-jade/p/9356815.html