题库练习 Left-handers, Right-handers and Ambidexters
← 上一题 下一题 →

A11574 | Left-handers, Right-handers and Ambidexters

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

题目描述

You are at a water bowling training. There are $l$ people who play with their left hand, $r$ people, who play with their right hand, and $a$ ambidexters, who can play with left or right hand.

The coach decided to form a team of even number of players, exactly half of the players should play with their right hand, and exactly half of the players should play with their left hand. One player should use only on of his hands.

Ambidexters play as well with their right hand as with their left hand. In the team, an ambidexter can play with their left hand, or with their right hand.

Please find the maximum possible size of the team, where equal number of players use their left and right hands, respectively.

输入格式

The only line contains three integers $l$ , $r$ and $a$ ( $0<=l,r,a<=100$ ) — the number of left-handers, the number of right-handers and the number of ambidexters at the training.

输出格式

Print a single even integer — the maximum number of players in the team. It is possible that the team can only have zero number of players.

输入输出样例

输入 #1
1 4 2
输出 #1
6
输入 #2
5 5 5
输出 #2
14
输入 #3
0 2 0
输出 #3
0
C++ 编辑器
输入
输出