Advertisement
sketkar

Make Square-ICL2023

Mar 10th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include "bits/stdc++.h"
  2. using namespace std;
  3. typedef long long ll;
  4. #define int ll
  5. typedef unsigned long long ull;
  6. typedef long double lld;
  7. #define all(x) (x).begin(), (x).end()
  8. #define MOD 1000000007
  9. #define endl '\n'
  10.  
  11. void fast_io()
  12. {
  13. ios_base::sync_with_stdio(false);
  14. cin.tie(NULL);
  15. cout.tie(NULL);
  16. }
  17.  
  18. void solve()
  19. {
  20. int a,b,c,d;
  21. cin>>a>>b>>c>>d;
  22.  
  23. int mini = min(a,b);
  24. mini = min(mini,c);
  25. mini = min(mini,d);
  26.  
  27. cout<<(a+b+c+d - (4*mini))<<endl;
  28.  
  29.  
  30. return;
  31. }
  32.  
  33. int32_t main()
  34. {
  35. fast_io();
  36. ll testcases=1;ll cse = 0;
  37. cin >> testcases;
  38. while (testcases--)
  39. {
  40. solve();
  41. }
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement