2412 - 电路检修

Input

Output

一个整数,表示最小代价

Examples

Input

4
8 24 12 6

Output

42
时间限制 1 秒
内存限制 128 MB
统计
上一题 下一题