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: 12ms
Memory: 1756kB
Author: 2018212212026
In contest: 1277


#include <cstdio>
#include <algorithm>
#include <iostream>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn=10005;
bool cmp(int a,int b)
{
	return a>b;
}
int main()
{
	int a,b,c,d,e,v1,v2,x;
	while(~scanf("%d%d%d%d%d",&a,&b,&c,&d,&e))
	{
		v1=a*b*c-2*d*((a-2*e)*(c-2*e)+(a-2*e)*(b-2*e)+(b-2*e)*(c-2*e));
		x=(a-2*d)*(b-2*d)*(c-2*d);
		v2=4*e*e*c+4*e*e*(a-2*e)+4*e*e*(b-2*e);
		if(e>d)
			printf("%d\n",v1);
		if(e<=d&&x>=v2)
			printf("%d\n",x);
		if(e<=d&&x<v2)
			printf("%d\n",v2);
	}
}