{"trustable":true,"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\u003eThere are $$$n$$$ candies in a row, they are numbered from left to right from $$$1$$$ to $$$n$$$. The size of the $$$i$$$-th candy is $$$a_i$$$.\u003c/p\u003e\u003cp\u003eAlice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy \u003cspan class\u003d\"tex-font-style-bf\"\u003efrom left to right\u003c/span\u003e, and Bob — \u003cspan class\u003d\"tex-font-style-bf\"\u003efrom right to left\u003c/span\u003e. The game ends if all the candies are eaten.\u003c/p\u003e\u003cp\u003eThe process consists of moves. During a move, the player eats one or more sweets from her/his side (Alice eats from the left, Bob — from the right).\u003c/p\u003e\u003cp\u003eAlice makes the first move. During the first move, she will eat $$$1$$$ candy (its size is $$$a_1$$$). Then, each successive move the players alternate — that is, Bob makes the second move, then Alice, then again Bob and so on.\u003c/p\u003e\u003cp\u003eOn each move, a player counts the total size of candies eaten during the current move. Once this number becomes strictly greater than the total size of candies eaten by the other player on their previous move, the current player stops eating and the move ends. In other words, on a move, a player eats the smallest possible number of candies such that the sum of the sizes of candies eaten on this move is \u003cspan class\u003d\"tex-font-style-bf\"\u003estrictly greater\u003c/span\u003e than the sum of the sizes of candies that the other player ate on the \u003cspan class\u003d\"tex-font-style-bf\"\u003eprevious\u003c/span\u003e move. If there are not enough candies to make a move this way, then the player eats up all the remaining candies and the game ends.\u003c/p\u003e\u003cp\u003eFor example, if $$$n\u003d11$$$ and $$$a\u003d[3,1,4,1,5,9,2,6,5,3,5]$$$, then:\u003c/p\u003e\u003cul\u003e \u003cli\u003e move 1: Alice eats one candy of size $$$3$$$ and the sequence of candies becomes $$$[1,4,1,5,9,2,6,5,3,5]$$$. \u003c/li\u003e\u003cli\u003e move 2: Alice ate $$$3$$$ on the previous move, which means Bob must eat $$$4$$$ or more. Bob eats one candy of size $$$5$$$ and the sequence of candies becomes $$$[1,4,1,5,9,2,6,5,3]$$$. \u003c/li\u003e\u003cli\u003e move 3: Bob ate $$$5$$$ on the previous move, which means Alice must eat $$$6$$$ or more. Alice eats three candies with the total size of $$$1+4+1\u003d6$$$ and the sequence of candies becomes $$$[5,9,2,6,5,3]$$$. \u003c/li\u003e\u003cli\u003e move 4: Alice ate $$$6$$$ on the previous move, which means Bob must eat $$$7$$$ or more. Bob eats two candies with the total size of $$$3+5\u003d8$$$ and the sequence of candies becomes $$$[5,9,2,6]$$$. \u003c/li\u003e\u003cli\u003e move 5: Bob ate $$$8$$$ on the previous move, which means Alice must eat $$$9$$$ or more. Alice eats two candies with the total size of $$$5+9\u003d14$$$ and the sequence of candies becomes $$$[2,6]$$$. \u003c/li\u003e\u003cli\u003e move 6 (the last): Alice ate $$$14$$$ on the previous move, which means Bob must eat $$$15$$$ or more. It is impossible, so Bob eats the two remaining candies and the game ends. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003ePrint the number of moves in the game and two numbers:\u003c/p\u003e\u003cul\u003e \u003cli\u003e $$$a$$$ — the total size of all sweets eaten by Alice during the game; \u003c/li\u003e\u003cli\u003e $$$b$$$ — the total size of all sweets eaten by Bob during the game. \u003c/li\u003e\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains an integer $$$t$$$ ($$$1 \\le t \\le 5000$$$) — the number of test cases in the input. The following are descriptions of the $$$t$$$ test cases.\u003c/p\u003e\u003cp\u003eEach test case consists of two lines. The first line contains an integer $$$n$$$ ($$$1 \\le n \\le 1000$$$) — the number of candies. The second line contains a sequence of integers $$$a_1, a_2, \\dots, a_n$$$ ($$$1 \\le a_i \\le 1000$$$) — the sizes of candies in the order they are arranged from left to right.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of the values of $$$n$$$ for all sets of input data in a test does not exceed $$$2\\cdot10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each set of input data print three integers — the number of moves in the game and the required values $$$a$$$ and $$$b$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e7\n11\n3 1 4 1 5 9 2 6 5 3 5\n1\n1000\n3\n1 1 1\n13\n1 2 3 4 5 6 7 8 9 10 11 12 13\n2\n2 1\n6\n1 1 1 1 1 1\n7\n1 1 1 1 1 1 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6 23 21\n1 1000 0\n2 1 2\n6 45 46\n2 2 1\n3 4 2\n4 4 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}