Advertisement
Guest User

wef

a guest
Jan 28th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <stdio.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. freopen("lesson.in", "r", stdin);
  10. freopen("lesson.out", "w", stdout);
  11.  
  12. long int a, b, c, d;
  13.  
  14. cin >> a >> b >> c >> d;
  15.  
  16. long long maxx = max(max(a*(b+c-d), d*(c+b-a)), max(c*(a+d-b), b*(d+a-c)));
  17.  
  18. if (a*(b+c-d) == maxx)
  19. cout << 0;
  20. else if (c*(a+d-b) == maxx)
  21. cout << 1;
  22. else if (d*(c+b-a) == maxx)
  23. cout << 2;
  24. else if (b*(d+a-c) == maxx)
  25. cout << 3;
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement