多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國(guó)內(nèi)最全I(xiàn)T社區(qū)平臺(tái) 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁(yè) > 互聯(lián)網(wǎng) > Codeforces Round #156 (Div. 2)---A. Greg's Workout

Codeforces Round #156 (Div. 2)---A. Greg's Workout

來源:程序員人生   發(fā)布時(shí)間:2014-11-10 08:04:19 閱讀次數(shù):2137次

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
2 2 8
output
biceps
input
3 5 1 10
output
back
input
7 3 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.






解題思路:水題。把所有數(shù)據(jù)掃1遍,直接計(jì)算每種鍛煉對(duì)應(yīng)的總次數(shù),找出3者中的最大值所對(duì)應(yīng)的鍛煉種類。







AC代碼:

#include <iostream> #include <cstdio> #include <algorithm> 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"<<endl; else if(xx == t) cout<<"biceps"<<endl; else cout<<"back"<<endl; } return 0; }


生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng)
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 女人18毛片a级毛片一区二区 | 国产在线一91区免费国产91 | 性欧美高清极品xx | 欧美激情在线精品video | 亚洲一级香蕉视频 | 日本a毛片在线播放 | 尤物视频免费 | 日本一区二区三区四区在线观看 | 亚洲欧美日韩高清在线看 | 亚洲一区二区三区精品国产 | 国产激情一区二区三区在线观看 | 亚洲成人资源 | 夜夜伊人| 2022偷拍午夜视频在线播放 | 久久久久亚洲精品一区二区三区 | 一二三四高清在线手机视频 | 国产美女啪啪 | 亚洲欧美中文字幕 | 337p日本欧洲亚洲大胆色噜噜 | 在线欧美一级毛片免费观看 | h视频免费观看 | 一级做a爰片欧美aaaa | 亚洲综合日韩精品欧美综合区 | 国产精品第1页在线播放 | 亚洲综合天堂 | 在线欧美69v免费观看视频 | 亚洲人成在线影院 | 激性欧美激情在线播放16页 | 亚洲第一在线视频 | 鸥美性生交xxxxx久久久 | 国产福利社区 | 欧美一级性 | 日本高清不卡免费 | 国产精品视频久久久久 | 在线视频www | 国产二区视频在线观看 | 免费a级作爱片免费观看中 免费a网站 | 69视频在线观看高清免费 | 欧美激情福利视频在线观看免费 | 在线观看亚洲一区 | 亚洲成a人片在线观看精品 亚洲成a人片在线观看尤物 |