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: 10ms
Memory: 1092kB
Author: 2018212212125
In contest: 1289

#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#define ll long long 
using namespace std;
const int maxn = 200010;
const int inf = 0x3f3f3f3f;
int  a, b, c, d, e;
int main()
{
	while (scanf("%d %d %d %d %d", &a, &b, &c, &d, &e) != EOF)
	{
		int a1 = a - 2 * e, b1 = b - 2 * e, c1 = c - 2 * e;
		int ans;
		if (d < e) {
			ans = a*b*c - 2 * d*(c1*a1 + c1 * b1 + b1 * a1);
			printf("%d\n", ans);
		}
		else {
			ans = max((a - 2 * d)*(b - 2 * d)*(c - 2 * d), 4 * e*e*c + 4 * e*e*(a1 + b1));
			printf("%d\n", ans);
		}
	}
	return 0;
}