#TEST1023. 那LH问你
那LH问你
Background
在讲课时发现有的同学居然还不知道什么是树,lh非常气愤,于是决定出一道题来考考大家。
Description
给定一个只包含整数的数组 , 对于一颗有 个节点的树 ,定义 如下:
- 若为树中节点的度,则
请你计算出最小的值。
保证最后的答案不超过
Format
Input
第一行输入一个整数:
第二行输入个整数:
Output
一个整数,代表的最小值
Samples1
4
3 2 5 2
24
Samples2
7
10 5 10 2 10 13 15
128
Limitation
2s, 1024MB for each test case.
Related
In following contests: