最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

CodeforcesRound#156(Div.2)-A.Greg'sWorkout_html/css

来源:动视网 责编:小采 时间:2020-11-27 15:57:29
文档

CodeforcesRound#156(Div.2)-A.Greg'sWorkout_html/css

CodeforcesRound#156(Div.2)-A.Greg'sWorkout_html/css_WEB-ITnose:Greg's Workout time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was
推荐度:
导读CodeforcesRound#156(Div.2)-A.Greg'sWorkout_html/css_WEB-ITnose:Greg's Workout time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was


Greg's Workout

time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1,?a2,?...,?an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exercise ai 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.

Input

The first line contains integer n (1?≤?n?≤?20). The second line contains n integers a1,?a2,?...,?an (1?≤?ai?≤?25) ? the number of times Greg repeats the exercises.

Output

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.

Sample test(s)

input

22 8

output

biceps

input

35 1 10

output

back

input

73 3 2 7 9 6 8

output

chest

Note

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.






解题思路:水题。把所有数据扫一遍,直接计算每种锻炼对应的总次数,找出三者中的最大值所对应的锻炼种类。







AC代码:

#include #include #include using namespace std;int main(){//	freopen("in.txt","r",stdin);	int n, k;	while(cin>>n){	int x = 0, xx = 0, xxx = 0;	for(int i=1; i<=n; i++){	cin>>k;	if(i%3==1) x += k;	else if(i%3==2) xx += k;	else xxx += k;	}	int t = max(x, max(xx, xxx));	if(x == t) cout<<"chest"<

文档

CodeforcesRound#156(Div.2)-A.Greg'sWorkout_html/css

CodeforcesRound#156(Div.2)-A.Greg'sWorkout_html/css_WEB-ITnose:Greg's Workout time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top