Advertisement
Ankit_132

F

Apr 8th, 2024
2,950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1.  
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. #define ll     long long
  7. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  8. #define pb     push_back
  9. #define ppb    pop_back
  10. #define pf     push_front
  11. #define ppf    pop_front
  12.  
  13. int main()
  14. {
  15.     _test
  16.     {
  17.         int a, b, c, d;
  18.         cin>>a>>b>>c>>d;
  19.  
  20.         int ans=(a/2)+(b/2)+(c/2)+(d/2);
  21.         if(a%2==1 && b%2==1 && c%2==1)
  22.             ans++;
  23.  
  24.         cout<<ans<<"\n";
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement