CF255A.Greg's Workout
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers _a_1, _a_2, ..., a__n. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exercise a__i times.
Greg now only does three types of exercises: "chest" exercises, "biceps" exercises and "back" exercises. Besides, his training is cyclic, that is, the first exercise he does is a "chest" one, the second one is "biceps", the third one is "back", the fourth one is "chest", the fifth one is "biceps", and so on to the n-th exercise.
Now Greg wonders, which muscle will get the most exercise during his training. We know that the exercise Greg repeats the maximum number of times, trains the corresponding muscle the most. Help Greg, determine which muscle will get the most training.
格雷格是一名初学者健身者。今天,健身房教练给了他一份训练计划。该计划仅包含 n 个整数 a1,a2,…,an。这些数字表示格雷格今天需要恰好完成 n 个训练动作,且第 i 个(按顺序)动作需重复 ai 次。
目前,格雷格只进行三种类型的训练:胸部(chest)、肱二头肌(biceps)和背部(back)训练。此外,他的训练是循环进行的:第一个动作是“胸部”训练,第二个是“肱二头肌”训练,第三个是“背部”训练,第四个又回到“胸部”训练,第五个是“肱二头肌”训练,依此类推,直到第 n 个动作。
现在格雷格想知道,在本次训练中,哪一块肌肉将得到最多的锻炼。已知:被重复次数最多的那个训练动作,其所对应的肌肉即为得到最多锻炼的肌肉。请帮助格雷格确定,哪一块肌肉将得到最多的训练。
输入格式
The first line contains integer n (1 ≤ n ≤ 20). The second line contains n integers _a_1, _a_2, ..., a__n (1 ≤ a__i ≤ 25) — the number of times Greg repeats the exercises.
第一行包含一个整数 n(1≤n≤20)。第二行包含 n 个整数 a1,a2,…,an(1≤ai≤25)——表示 Greg 重复各项运动的次数。
输出格式
Print word "chest" (without the quotes), if the chest gets the most exercise, "biceps" (without the quotes), if the biceps gets the most exercise and print "back" (without the quotes) if the back gets the most exercise.
It is guaranteed that the input is such that the answer to the problem is unambiguous.
如果胸部锻炼最多,输出单词 “chest”(不含引号);如果肱二头肌锻炼最多,输出 “biceps”(不含引号);如果背部锻炼最多,输出 “back”(不含引号)。
保证输入数据使得本题答案是明确唯一的。
输入输出样例
输入#1
2 2 8
输出#1
biceps
输入#2
3 5 1 10
输出#2
back
输入#3
7 3 3 2 7 9 6 8
输出#3
chest
说明/提示
In the first sample Greg does 2 chest, 8 biceps and zero back exercises, so the biceps gets the most exercises.
In the second sample Greg does 5 chest, 1 biceps and 10 back exercises, so the back gets the most exercises.
In the third sample Greg does 18 chest, 12 biceps and 8 back exercises, so the chest gets the most exercise.
在第一个样例中,Greg 进行了 2 次胸部、8 次肱二头肌和 0 次背部训练,因此肱二头肌的训练次数最多。
在第二个样例中,Greg 进行了 5 次胸部、1 次肱二头肌和 10 次背部训练,因此背部的训练次数最多。
在第三个样例中,Greg 进行了 18 次胸部、12 次肱二头肌和 8 次背部训练,因此胸部的训练次数最多。
输入解题思路,AI测评打分。不知道怎么写?