#include #include using namespace std; int main(void) { int a, b, c, d; int v[4]; int i, j, k, m; int max = INT_MIN; int crt; cin >> a >> b >> c >> d; v[0] = a; v[1] = b; v[2] = c; v[3] = d; for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) for (k = 0; k < 4; k++) for (m = 0; m < 4; m++) { if (i != j && i != k && i != m && j != m && j != k && k != m) { crt = v[i] * v[j] + v[k] * v[m]; if (crt > max) max = crt; } } cout << max << endl; return 0; }