{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\n While playing a 2D game of two players, two friends found a sequence of \u003cb\u003eN\u003c/b\u003e coins placed one after another in a row. The value of the \u003cb\u003eith\u003c/b\u003e coin is \u003cb\u003ev\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e. None of the friends wanted to take all the coins for himself, so they decided to play a minigame of their own. The first player stood on the leftmost side of the sequence and the second player stood on the righmost side. Then their minigame started. \n\u003c/p\u003e\n\n\u003cp\u003e\n The minigame consists of alternating moves. During a move, the player takes one of more coins from his respective side (the first player takes from the left, and the second player takes from the right).\n\u003c/p\u003e\n\n\u003cp\u003e\n In the very first move, the first player takes exactly one coin from the left side (the very first one), then from the second move the players alternate — that is the second player makes the second move, then the first player makes the 3rd move, then the second player makes the 4th move and so on.\n\u003c/p\u003e\n\n\u003cp\u003e\n Except from the first move, the players strictly follow the following move: On each move, the current player calculates the total value accumulated by him during the current move and onces this value becomes strictly greater than the total value accumulated by the other player in the previous move, the current player stops taking the coins and the current move ends. In other words, on a move, a player takes the smallest number of coins such that the sum of values of the coins taken in this move is strictly greater than the sum of values of the coins taken by the other player in the previous move. If the sum of values of all the remaining coins is not strictly greater than the sum of values of coins taken in the previous move, the current player will take all the coins and the game will end. It is to be noted that the players take the coins from their respective sides without skipping any coin. \n\u003c/p\u003e\n\n\u003cp\u003e\n For example, if \u003cb\u003eN \u003d 11\u003c/b\u003e and the sequence of coins is \u003cb\u003ev \u003d [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]\u003c/b\u003e, then:\n \u003cul\u003e\n \u003cli\u003eMove 1: The first player takes the first coin of value 3. The sequence becomes \u003cb\u003e[1, 4, 1, 5, 9, 2, 6, 5, 3, 5]\u003c/b\u003e.\u003c/li\u003e\n \n \u003cli\u003eMove 2: The first player attained a value of 3 in the previous move, so the second player must get 4 or more. He takes the one coin of value 5 and the sequence becomes \u003cb\u003e[1, 4, 1, 5, 9, 2, 6, 5, 3]\u003c/b\u003e.\u003c/li\u003e\n\n \u003cli\u003eMove 3: The second player got 5 in the previous move, so the first player must get 6 or more. He takes 3 coins with total value 1 + 4 + 1 \u003d 6 and the sequence becomes \u003cb\u003e[5, 9, 2, 6, 5, 3]\u003c/b\u003e.\u003c/li\u003e\n\n \u003cli\u003eMove 4: The second player takes two coins with value 3 + 5 \u003d 8 and the sequence becomes \u003cb\u003e[5, 9, 2, 6]\u003c/b\u003e,\u003c/li\u003e\n\n \u003cli\u003eMove 5: The first player takes two coins with value 5 + 9 \u003d 14 and the sequence becomes \u003cb\u003e[2, 6]\u003c/b\u003e\u003c/li\u003e\n\n \u003cli\u003eMove 6: The first player got 14 in the previous turn and the sum of values of the remaining coins is 2 + 6 \u003d 8 which is not strictly greater than 14. So the second player takes all the remaining coins and the game ends.\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/p\u003e\n\n\u003cp\u003ePrint the total number of moves in the game and two numbers \u003cbr\u003e\n\u003cb\u003ea\u003c/b\u003e \u003d the total value attained by the first player in the whole game\u003cbr\u003e\n\u003cb\u003eb\u003c/b\u003e \u003d the total value attained by the second player in the whole game\n\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\n The first line of the input consists of an integer \u003cb\u003et (1 \u0026le; t \u0026le; 5000)\u003c/b\u003e — the number of test cases. The following are the descriptions of the \u003cb\u003et\u003c/b\u003e test cases.\n\u003c/p\u003e\n\n\u003cp\u003e\n Each test case consists of two lines. The first line contains an integer \u003cb\u003eN (1 \u0026le; n \u0026le; 1000)\u003c/b\u003e — the number of coins. The second line contains an a sequence of integers \u003cb\u003ev\u003csub\u003e1\u003c/sub\u003e, v\u003csub\u003e2\u003c/sub\u003e, . . . , v\u003csub\u003en\u003c/sub\u003e\u003c/b\u003e — the values of coins in the order they are arranged from left to right.\n\u003c/p\u003e\n\n\u003cp\u003e\n It is guaranteed that the sum of \u003cb\u003eN\u003c/b\u003e for all sets of input data in a test case does not exceed 2 \u0026times; 10\u003csup\u003e5\u003c/sup\u003e.\n\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\n For each set of input data, print three integers — the number of moves in the game and the required values \u003cb\u003ea\u003c/b\u003e and \u003cb\u003eb\u003c/b\u003e.\n\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"7\u003cbr\u003e\n11\u003cbr\u003e\n3 1 4 1 5 9 2 6 5 3 5\u003cbr\u003e\n1\u003cbr\u003e\n1000\u003cbr\u003e\n3\u003cbr\u003e\n1 1 1\u003cbr\u003e\n13\u003cbr\u003e\n1 2 3 4 5 6 7 8 9 10 11 12 13\u003cbr\u003e\n2\u003cbr\u003e\n2 1\u003cbr\u003e\n6\u003cbr\u003e\n1 1 1 1 1 1\u003cbr\u003e\n7\u003cbr\u003e\n1 1 1 1 1 1 1\u003cbr\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"6 23 21\u003cbr\u003e\n1 1000 0\u003cbr\u003e\n2 1 2\u003cbr\u003e\n6 45 46\u003cbr\u003e\n2 2 1\u003cbr\u003e\n3 4 2\u003cbr\u003e\n4 4 3\u003cbr\u003e"}}]}