Advertisement
semsem_elazazy

Untitled

Apr 21st, 2022
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. #include<utility>
  4. #include <queue>
  5. #define ll long long
  6. #define ull unsigned long long
  7. #define pi  3.14159
  8.  
  9. #define OO  2000000000
  10. //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
  11. using namespace std;
  12.  
  13. void yasmeen_fakhri(){
  14.   ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  15.   #ifndef ONLINE_JUDGE  
  16.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  17.   #endif
  18. }
  19.  
  20. int main() {
  21.    yasmeen_fakhri();
  22.    int n;   cin>>n;
  23.    int arr[n];
  24.    for(int i =1 ; i<=n ; i++){
  25.        cin>>arr[i];
  26.    }
  27.    int a=0 , b=0 , c=0 ;
  28.    for(int i =1 ; i<=n ; i++){
  29.        if      (i % 3 == 1) a+=arr[i];
  30.        else if (i % 3 == 2) b+=arr[i];
  31.        else if (i % 3 == 0) c+=arr[i];
  32.    }
  33.    int maxx = INT_MIN;
  34.    maxx = max(max(a,b),c);
  35.    if       (maxx == a) cout<<"chest";
  36.    else if  (maxx == b) cout<<"biceps";
  37.    else if  (maxx == c) cout<<"back";
  38. return 0;
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement