AtCoder Beginner Contest 159 比赛人数8276 快,比赛开始后3分钟看到所有题
AtCoder Beginner Contest 159 C Maximum Volume 基本不等式
总目录详见https://blog.csdn.net/mrcrack/article/details/104454762
在线测评地址https://atcoder.jp/contests/abc159/tasks/abc159_c
y=(L-a-b)*a*b
求y的最大值,
因L-a-b+a+b=L
当且仅当L-a-b==a==b时取极大值
即a=L/3
AC代码如下
#include <stdio.h>
#define LL long long
int main(){
LL l;
scanf("%lld",&l);
printf("%.12lf\n",l*l*l*1.0/3/3/3);
return 0;
}