Codeforces Round 469 (Div. 2)
A
Left-handers, Right-handers and Ambidexters
Codeforces
800
原题
←B →
翻译中…

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.

翻译中…

Input

翻译中…

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.

翻译中…

Output

翻译中…

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.

翻译中…

Note

翻译中…

In the first example you can form a team of $6$ players. You should take the only left-hander and two ambidexters to play with left hand, and three right-handers to play with right hand. The only person left can't be taken into the team.

翻译中…

In the second example you can form a team of $14$ people. You have to take all five left-handers, all five right-handers, two ambidexters to play with left hand and two ambidexters to play with right hand.

翻译中…

样例

Input #1
1 4 2
Output #1
6
InputCopy OutputCopy
Input #2
5 5 5
Output #2
14
InputCopy OutputCopy
Input #3
0 2 0
Output #3
0
InputCopy OutputCopy
题目信息
题号
950A
时间限制
1 s
内存限制
256 MB
标签
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。