{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eWelcome to Galilei Town, a high and new technology industrial development zone surrounding the Dishui lake. N villages numbered from 0 to N - 1 are located along the lake and a loop-line bus is the only transportation in this town. The bus is a one-way line passing the villages 0, 1, 2, ... , N - 1 successively, going back to the 0-th village and continuing the above route.\u003cbr\u003eWe may measure the landscape of the i-th villages by an integer $w_i$ and $\\sum_{i\u003d0}^{N-1}$ $w_i$ \u003d 0. Once a traveller takes the bus from the u-th village to the v-th village, he would evaluate the experience by two coefficients a \u003d $w_v$ and b the sum of w(s) which $b \u003d w_0 + w_1 + ... + w_v$. The data is guaranteed that the sum $b \\ge 0$. Now, as the tour guide, you need to design a travel brochure for guests who came from far away. Your task is to choose a village $i_0$ as the starting village of the travel and at least two more villages $i_1, i_2, ... , i_k$. Guests would\u003cbr\u003estart their travel from the $i_0$-th village and visit the planned k villages in sequence by loop-line bus. Finally they will go back to the $i_0$-th village from the $i_k$-th one and finish their travel. If we let $i_{k+1} \u003d i_0$, the whole travel would be evaluated by the score $\\frac{1}{2} \\sum_{j\u003d0}^{k}(a_{i_{j+1}} - a_{i_j})\\frac{b_{i_{j}}b_{i_{j+1}}}{a_{i_{j}}a_{i_{j+1}}}$. The negative contribution to the score are requested to be the summation of a contiguous piece. You need to know the maximum possible score.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of input contains an integer t which is the number of test cases. Then t test cases follow. For each test case, the first line consists of an integer N (3 ≤ N ≤ 100000). The second line consists of N non-zero integers\u003cbr\u003e$w_0$ to $w_{N-1}$ where each $w_i$ satisfies $|w_i|$ ≤ 100. We guarantee that the sum of $w_i$ would be zero.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each case, output the maximum score of the whole evaluation rounded to 5 decimal places behind the decimal point in a line."}},{"title":"Sample","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\u003e1\r\n10\r\n1 4 1 2 -3 -5 2 -2 2 -2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e28.66667\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cbr\u003eThe best route starts from the 5-th village. Go passing the 6-th, 7-th, 8-th, 9-th, 0-th, 1-st, 2-nd, 3-rd villages and arrive at the 4-th village. Then go around the lake to the 3-rd village. Again go to the 2-nd village and back to the 5-th village.\u003cbr\u003e"}}]}