Start: Jul, 01, 2019 08:30:00
2019年度暑期短学期第四天
End: Jul, 01, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: A
Result: Accepted
Time: 8ms
Memory: 1120kB
Author: 2018212212149
In contest: 1277

#include<stdio.h>
#include<math.h>
int main()
{
	int a,b,c,d,e,v,_v,v1,v2;
	while(scanf("%d%d%d%d%d",&a,&b,&c,&d,&e)!=EOF)
	{
		if(d>=e)
		{
			v1=(a-2*d)*(b-2*d)*(c-2*d);
			v2=4*(e*c*e)+4*(a-2*e)*e*e+4*(b-2*e)*e*e;
			if(v1>v2)
			{
				printf("%d\n",v1);
			}
				else
				printf("%d\n",v2);
		}
		else
		{
			v=a*b*c-(2*d*((a-2*e)*(b-2*e)+(a-2*e)*(c-2*e)+(b-2*e)*(c-2*e)));
			printf("%d\n",v);
		}
		
	}
}