{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eGiven an array with \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e positive integers \u003cspan class\u003d\"tex2jax_process\"\u003e$a_1, \\dots , a_ n$\u003c/span\u003e, compute the maximal value of the following expression\u003c/p\u003e\u003cspan class\u003d\"tex2jax_process\"\u003e\\[ \\left(a_1^2 + \\dots + a_ k^2\\right) \\cdot \\left(a_{k+1} + \\dots + a_ n\\right) \\]\u003c/span\u003e \n\u003ch2\u003eInput\u003c/h2\u003e \n\u003cul class\u003d\"itemize\"\u003e \n \u003cli\u003e \u003cp\u003eA single line containing an integer \u003cspan class\u003d\"tex2jax_process\"\u003e$2\\leq n\\leq 10^6$\u003c/span\u003e.\u003c/p\u003e \u003c/li\u003e \n \u003cli\u003e \u003cp\u003eThen follow \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e lines with the elements of the array, the \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003eth of which contains the integer \u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq a_ i \\leq 100$\u003c/span\u003e.\u003c/p\u003e \u003c/li\u003e \n\u003c/ul\u003e \n\u003ch2\u003eOutput\u003c/h2\u003e \n\u003cp\u003eOutput the maximal value of the expression mentioned above.\u003c/p\u003e \n\u003ctable class\u003d\"sample\" summary\u003d\"sample data\"\u003e \n \u003ctbody\u003e\n \u003ctr\u003e \n \u003cth\u003eSample Input 1\u003c/th\u003e \n \u003cth\u003eSample Output 1\u003c/th\u003e \n \u003c/tr\u003e \n \u003ctr\u003e \n \u003ctd\u003e \u003cpre\u003e5\n2\n1\n4\n3\n5\n\u003c/pre\u003e \u003c/td\u003e \n \u003ctd\u003e \u003cpre\u003e168\n\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003c/tbody\u003e\n\u003c/table\u003e \n\u003ctable class\u003d\"sample\" summary\u003d\"sample data\"\u003e \n \u003ctbody\u003e\n \u003ctr\u003e \n \u003cth\u003eSample Input 2\u003c/th\u003e \n \u003cth\u003eSample Output 2\u003c/th\u003e \n \u003c/tr\u003e \n \u003ctr\u003e \n \u003ctd\u003e \u003cpre\u003e2\n1\n1\n\u003c/pre\u003e \u003c/td\u003e \n \u003ctd\u003e \u003cpre\u003e1\n\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003c/tbody\u003e\n\u003c/table\u003e \n\u003ctable class\u003d\"sample\" summary\u003d\"sample data\"\u003e \n \u003ctbody\u003e\n \u003ctr\u003e \n \u003cth\u003eSample Input 3\u003c/th\u003e \n \u003cth\u003eSample Output 3\u003c/th\u003e \n \u003c/tr\u003e \n \u003ctr\u003e \n \u003ctd\u003e \u003cpre\u003e10\n8\n5\n10\n9\n1\n4\n12\n6\n3\n13\n\u003c/pre\u003e \u003c/td\u003e \n \u003ctd\u003e \u003cpre\u003e10530\n\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003c/tbody\u003e\n\u003c/table\u003e"}}]}