#include //written by Dan int main() { int v[4], aux, i, j; scanf("%d %d %d %d", &v[0], &v[1], &v[2], &v[3]); for (i = 0; i < 3; i++) { for (j = i + 1; j < 4; j++) { if (v[i] > v[j]) { aux = v[i]; v[i] = v[j]; v[j] = aux; } } } printf("%d", (v[0] * v[1] + v[2] * v[3])); return 0; }