Advertisement
Mirbek

F. Максимум

Jan 26th, 2022
851
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const int inf = 1e9;
  6.  
  7. int main(){
  8.     int a, b, c, d;
  9.     cin >> a >> b >> c >> d;
  10.  
  11.     int ans = -inf;
  12.  
  13.     ans = max(ans, a * b + c * d);
  14.     ans = max(ans, a * c + b * d);
  15.     ans = max(ans, a * d + b * c);
  16.  
  17.     cout << ans << endl;
  18. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement