{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"乔治拿来一组等长的木棒,将它们随机的砍掉,得到若干根小木棍,并使每一节小棍的长度都不超过50个单位。然后他又想把这些木棍拼接起来,恢复到裁剪前的状态,但他忘记了初始时有多少木棒以及木棒的初始长度。请你设计一个程序,帮助乔治计算木棒的可能最小长度,每一节木棍的长度都用大于零的整数表示。\n\n输入包含多组数据,每组数据包括两行。第一行是一个不超过64的整数,表示砍断之后具有多少节木棍。第二行是截断以后,所得到的各节木棍的长度。在最后一组数据之后。是一个零。\n\n对于每组数据,分别输出原始木棒的可能最小长度。"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eThe input contains blocks of 2 lines. The first line contains the number of sticks parts after cutting, there are at most 64 sticks. The second line contains the lengths of those parts separated by the space. The last line of the file contains zero.\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eThe output should contains the smallest possible length of original sticks, one per line. \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e9\n5 2 1 5 2 1 5 2 1\n4\n1 2 3 4\n0\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e6\n5\u003c/pre\u003e"}}]}