日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 互聯網 > Codeforces Round #156 (Div. 2)---A. Greg's Workout

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

來源:程序員人生   發布時間:2014-11-10 08:04:19 閱讀次數:2140次

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.






解題思路:水題。把所有數據掃1遍,直接計算每種鍛煉對應的總次數,找出3者中的最大值所對應的鍛煉種類。







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; }


生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------

上一篇 Flex下拉框

下一篇 淺談觸發器使用

分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 天天干狠狠干 | 久久人人网 | 精品国产黄a∨片高清在线 五月色综合 | 亚洲黄色三级 | 国产精品美女久久久久 | 蜜桃永久免费 | av一区二区三区 | 成人高清 | 午夜视频福利网站 | a天堂视频 | 欧美gay网站| 中国一级毛片在线播放 | 中文字幕在线电影 | 精品99在线 | 欧美a网| 亚洲视频精品在线 | 91精品国产高清一区二区三区 | 国产激情精品一区二区三区 | 手机看片福利永久 | 欧美中文字幕在线 | 国产在线一二 | 综合一区二区三区 | 亚洲精品视频二区 | 日韩欧美一级在线 | 中文字幕91在线 | 在线免费黄色小视频 | 久久久成人av | 亚洲一区二区三区影院 | www久| 欧美精品在线免费观看 | 国产成人精品久久 | 青青青爽久久午夜综合久久午夜 | 一区二区精品在线 | 成人免费在线观看 | 国产一级毛片一区二区 | 黄色一级片在线看 | 久久久久久久久久久美女 | 亚洲婷婷中文字幕 | 久久手机免费视频 | 另类激情亚洲 | 色网影院 |