| 5 | typedef long long int ll; |
| 6 | |
| 7 | int main() |
| 8 | { |
| 9 | // a for chest, b for biceps and c for back |
| 10 | |
| 11 | int n, t, a=0, b=0, c=0; |
| 12 | cin >> n; |
| 13 | |
| 14 | // Here we are not storing the n integers in an array. |
| 15 | // Instead, we know 1, 1+3, 1+3+3 entry corresponds to chest |
| 16 | // Similarly 2, 2+3, 2+3+3 entry corresponds to biceps |
| 17 | // 3, 3+3, 3+3+3 entry corresponds to chest. |
| 18 | // To be more clear the n integers are like chest, biceps, back, chest, biceps, back and so on upto n. |
| 19 | for (int i = 1; i <= n; i++) // Loop Runs for 'n' Times. |
| 20 | { |
| 21 | cin >> t; // This is nth integer |
| 22 | if (i % 3 == 1) |
| 23 | a += t; |
| 24 | else if (i % 3 == 2) |
| 25 | b += t; |
| 26 | else |
| 27 | c += t; |
| 28 | } |
| 29 | |
| 30 | // Now applying the logic of maximum among 3 numbers and displaying the desired result. |
| 31 | if (a>b && a > c) |
| 32 | cout << "chest" << endl; |
| 33 | else if (b>a && b>c) |
| 34 | cout << "biceps" << endl; |
| 35 | else |
| 36 | cout << "back" << endl; |
| 37 | |
| 38 | return 0; |
| 39 | } |
nothing calls this directly
no outgoing calls
no test coverage detected