{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" \n \u003cp\u003eLittle Hi and Little Ho are playing a game. There is an integer array in front of them. They take turns (Little Ho goes first) to select a number from either the beginning or the end of the array. The number will be added to the selecter\u0027s score and then be removed from the array. \u003c/p\u003e \n \u003cp\u003eGiven the array what is the maximum score Little Ho can get? Note that Little Hi is smart and he always uses the optimal strategy. \u003cbr\u003e\u003c/p\u003e \n "}},{"title":"Input","value":{"format":"HTML","content":" \n \u003cp\u003eThe first line contains an integer N denoting the length of the array. (1 ≤ \u003cvar\u003eN\u003c/var\u003e ≤ 1000)\u003c/p\u003e \n \u003cp\u003eThe second line contains \u003cvar\u003eN\u003c/var\u003e integers \u003cvar\u003eA\u003csub\u003e1\u003c/sub\u003e\u003c/var\u003e, \u003cvar\u003eA\u003csub\u003e2\u003c/sub\u003e\u003c/var\u003e, ... \u003cvar\u003eA\u003csub\u003eN\u003c/sub\u003e\u003c/var\u003e, denoting the array. (-1000 ≤ \u003cvar\u003eA\u003csub\u003ei\u003c/sub\u003e\u003c/var\u003e ≤ 1000) \u003cbr\u003e\u003c/p\u003e \n "}},{"title":"Output","value":{"format":"HTML","content":" \n \u003cp\u003eOutput the maximum score Little Ho can get.\u003c/p\u003e \n \u003c/div\u003e \n "}},{"title":"Sample Input","value":{"format":"HTML","content":" \n \u003cpre\u003e4\r\n-1 0 100 2\u003c/pre\u003e \n "}},{"title":"Sample Output","value":{"format":"HTML","content":" \n \u003cpre\u003e99\u003c/pre\u003e \n "}}]}