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: 2018212212231
In contest: 1277

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