题库练习 Cableway
← 上一题 下一题 →

A8264 | Cableway

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

A group of university students wants to get to the top of a mountain to have a picnic there. For that they decided to use a cableway.

A cableway is represented by some cablecars, hanged onto some cable stations by a cable. A cable is scrolled cyclically between the first and the last cable stations (the first of them is located at the bottom of the mountain and the last one is located at the top). As the cable moves, the cablecar attached to it move as well.

The number of cablecars is divisible by three and they are painted three colors: red, green and blue, in such manner that after each red cablecar goes a green one, after each green cablecar goes a blue one and after each blue cablecar goes a red one. Each cablecar can transport no more than two people, the cablecars arrive with the periodicity of one minute (i. e. every minute) and it takes exactly $30$ minutes for a cablecar to get to the top.

All students are divided into three groups: $r$ of them like to ascend only in the red cablecars, $g$ of them prefer only the green ones and $b$ of them prefer only the blue ones. A student never gets on a cablecar painted a color that he doesn't like,

The first cablecar to arrive (at the moment of time $0$ ) is painted red. Determine the least time it will take all students to ascend to the mountain top.

输入格式

The first line contains three integers $r$ , $g$ and $b$ ( $0<=r,g,b<=100$ ). It is guaranteed that $r+g+b>0$ , it means that the group consists of at least one student.

输出格式

Print a single number — the minimal time the students need for the whole group to ascend to the top of the mountain.

输入输出样例

输入 #1
1 3 2
输出 #1
34
输入 #2
3 2 1
输出 #2
33
C++ 编辑器
输入
输出