Start: Jun, 28, 2019 13:00:00
2019年度暑期短学期第四天-助教场
End: Jun, 30, 2019 23:59:00
Time elapsed:
Time remaining:

Problem_ID: A
Result: Accepted
Time: 12ms
Memory: 1712kB
Author: 2018212212127
In contest: 1289

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
const int maxn=3e5+5;
int main(){
	int a,b,c,d,e;
	while(~scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)){
		if(d<e) printf("%d\n",a*b*c-2*d*(a-2*e)*(c-2*e)-2*d*(a-2*e)*(b-2*e)-2*d*(b-2*e)*(c-2*e));\
		else printf("%d\n",max((a-2*d)*(b-2*d)*(c-2*d),4*e*e*c+4*e*e*(a-2*e)+4*e*e*(b-2*e)));
	}
}