博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
B - Greg's Workout CodeForces - 255A(思维)
阅读量:4136 次
发布时间:2019-05-25

本文共 2108 字,大约阅读时间需要 7 分钟。

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.

Examples

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.

大水题一道,不多解释,代码给上:

#include
#include
#include
#include
using namespace std;int n;int main(){ while(cin>>n) { int a=0,b=0,c=0; int x; for(int i=1;i<=n;i++) { cin>>x; if(i%3==1) a+=x; else if(i%3==2) b+=x; else if(i%3==0) c+=x; } int y=max(a,max(b,c)); if(y==a) cout<<"chest"<

努力加油a啊,(o)/~

转载地址:http://gzxvi.baihongyu.com/

你可能感兴趣的文章
初始化VUE项目报错
查看>>
vue项目使用安装sass
查看>>
HTTP和HttpServletRequest 要点
查看>>
在osg场景中使用GLSL语言——一个例子
查看>>
laravel 修改api返回默认的异常处理
查看>>
laravel事务
查看>>
【JavaScript 教程】浏览器—History 对象
查看>>
还不会正则表达式?看这篇!
查看>>
100道+ JavaScript 面试题,助你查漏补缺
查看>>
JavaScript深入理解之闭包
查看>>
这才是学习Vite2的正确姿势!
查看>>
7 个适用于所有前端开发人员的很棒API,你需要了解一下
查看>>
25个构建Web项目的HTML建议,你需要了解一下!
查看>>
【web素材】02-10款大气的购物商城网站模板
查看>>
6种方式实现JavaScript数组扁平化(flat)方法的总结
查看>>
如何实现a===1 && a===2 && a===3返回true?
查看>>
49个在工作中常用且容易遗忘的CSS样式清单整理
查看>>
20种在学习编程的同时也可以在线赚钱的方法
查看>>
隐藏搜索框:CSS 动画正反向序列
查看>>
12 个JavaScript 特性技巧你可能从未使用过
查看>>