{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"在该题中,请不要使用#include\u003c bits/stdc++.h\u003e 和任何c++11及以上的特性\u003cbr\u003e\n给出n个数字v(i),每次你可以取出最左边的数字或者取出最右边的数字,一共取n次取完。假设你第i次取的数字是x,那么你可以获得i*x的价值。现在你需要规划取数顺序,使得总价值和最大。\n "}},{"title":"Input","value":{"format":"HTML","content":"第一行一个数字n(1\u003c\u003dn\u003c\u003d2000)。\u003cbr\u003e\n下面n行每行一个数字v(i)。(1\u003c\u003dv(i)\u003c\u003d1000)"}},{"title":"Output","value":{"format":"HTML","content":"输出一个数字,表示最大总价值和。"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e5\n1\n3\n1\n5\n2\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e43\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"按照这种下标顺序取数: 1, 5, 2, 3, 4\u003cbr\u003e\n 1x1 + 2x2 + 3x3 + 4x1 + 5x5 \u003d 43.\n \u003c/div\u003e"}}]}