Codeforces Round 386 (Div. 2)
A
Compote
Codeforces
800
原题
←B →
翻译中…

Nikolay has $*a*$ lemons, $*b*$ apples and $*c*$ pears. He decided to cook a compote. According to the recipe the fruits should be in the ratio $1: 2: 4$. It means that for each lemon in the compote should be exactly $2$ apples and exactly $4$ pears. You can't crumble up, break up or cut these fruits into pieces. These fruits — lemons, apples and pears — should be put in the compote as whole fruits.

翻译中…

Your task is to determine the maximum total number of lemons, apples and pears from which Nikolay can cook the compote. It is possible that Nikolay can't use any fruits, in this case print $0$.

翻译中…

Input

翻译中…

The first line contains the positive integer $*a*$ ($1 ≤ *a* ≤ 1000$) — the number of lemons Nikolay has.

翻译中…

The second line contains the positive integer $*b*$ ($1 ≤ *b* ≤ 1000$) — the number of apples Nikolay has.

翻译中…

The third line contains the positive integer $*c*$ ($1 ≤ *c* ≤ 1000$) — the number of pears Nikolay has.

翻译中…

Output

翻译中…

Print the maximum total number of lemons, apples and pears from which Nikolay can cook the compote.

翻译中…

Note

翻译中…

In the first example Nikolay can use $1$ lemon, $2$ apples and $4$ pears, so the answer is $1 + 2 + 4 = 7$.

翻译中…

In the second example Nikolay can use $3$ lemons, $6$ apples and $12$ pears, so the answer is $3 + 6 + 12 = 21$.

翻译中…

In the third example Nikolay don't have enough pears to cook any compote, so the answer is $0$.

翻译中…

样例

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

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