2412 - 电路检修

Input

Output

一个整数,表示最小代价

Examples

Input

4
8 24 12 6

Output

42
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题