{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e这是一道区间DP的模板题,没有学过的话可以自行百度\u003c/p\u003e\n\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003e一条直线上摆放着一行共\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003en\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003e堆的石子。现要将石子有序地合并成一堆。规定每次只能选相邻的两堆合并成新的一堆,并将新的一堆石子数记为该次合并的得分。请编辑计算出将\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003en\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003e堆石子合并成一堆的最小得分和将\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003en\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003e堆石子合并成一堆的最大得分。\u003c/span\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:SimSun;font-size:16px;\"\u003e输入有多组测试数据。\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:SimSun;font-size:16px;\"\u003e每组第一行为n(n\u0026lt;\u003c/span\u003e\u003cspan style\u003d\"font-family:SimSun;font-size:16px;\"\u003e\u003d\u003c/span\u003e\u003cspan style\u003d\"font-family:SimSun;font-size:16px;\"\u003e100),表示有n堆石子,。\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:SimSun;font-size:16px;\"\u003e二行为n个用空格隔开的整数,依次表示这n堆石子的石子数量ai(0\u0026lt;ai\u0026lt;\u003d100)\u003c/span\u003e \u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003e每组测试数据输出有一行。输出将n堆石子合并成一堆的最小得分和将n堆石子合并成一堆的最大得分。\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:\u0027font-size:12pt;\"\u003e\u003c/span\u003e\u003cspan style\u003d\"white-space:normal;font-family:SimSun;font-size:16px;\"\u003e\u0026nbsp;中间用空格分开。\u003c/span\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:SimSun;font-size:16px;\"\u003e3\u003c/span\u003e\u003cspan style\u003d\"font-family:\u0027font-size:12pt;\"\u003e\u003c/span\u003e \u003c/p\u003e \u003cp style\u003d\"white-space:normal;\"\u003e \u003cspan style\u003d\"font-family:SimSun;font-size:16px;\"\u003e1\u0026nbsp;2\u0026nbsp;3\u003c/span\u003e \u003c/p\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cspan style\u003d\"font-family:SimSun;font-size:16px;line-height:24px;white-space:normal;\"\u003e\u003c/span\u003e\u003cspan style\u003d\"font-family:SimSun;font-size:16px;line-height:24px;white-space:normal;\"\u003e9\u0026nbsp;11\u003c/span\u003e"}}]}