#include using namespace std; #define x first #define y second typedef pair pii; typedef pair pdd; typedef long long ll; typedef unsigned long long ull; int main () { #ifndef ONLINE_JUDGE ifstream fin("input.txt"); // #undef cin // #define cin fin #endif int a[] = {0, 1, 2, 3}; int b[4]; for(int i = 0; i < 4; i++) cin >> b[i]; int mx = 0; do { mx = max(mx, b[a[0]] * b[a[1]] + b[a[2]] * b[a[3]]); } while(next_permutation(a, a+4)); cout << mx; return 0; }