{"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\u003eAndrey is just starting to come up with problems, and it\u0027s difficult for him. That\u0027s why he came up with a strange problem about permutations$$$^{\\dagger}$$$ and asks you to solve it. Can you do it?\u003c/p\u003e\u003cp\u003eLet\u0027s call the \u003cspan class\u003d\"tex-font-style-it\"\u003ecost\u003c/span\u003e of a permutation $$$p$$$ of length $$$n$$$ the value of the expression:\u003c/p\u003e\u003ccenter\u003e \u003cspan\u003e$$$(\\sum_{i \u003d 1}^{n} p_i \\cdot i) - (\\max_{j \u003d 1}^{n} p_j \\cdot j)$$$\u003c/span\u003e. \u003c/center\u003e\u003cp\u003eFind the maximum cost among all permutations of length $$$n$$$.\u003c/p\u003e\u003cp\u003e$$$^{\\dagger}$$$A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n\u003d3$$$ but there is $$$4$$$ in the array).\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eEach test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \\le t \\le 30$$$) — the number of test cases. The description of the test cases follows.\u003c/p\u003e\u003cp\u003eThe only line of each test case contains a single integer $$$n$$$ ($$$2 \\le n \\le 250$$$) — the length of the permutation.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$500$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, output a single integer — the maximum cost among all permutations of length $$$n$$$.\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\u003e5\n2\n4\n3\n10\n20\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n17\n7\n303\n2529\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, the permutation with the maximum cost is $$$[2, 1]$$$. The cost is equal to $$$2 \\cdot 1 + 1 \\cdot 2 - \\max (2 \\cdot 1, 1 \\cdot 2)\u003d 2 + 2 - 2 \u003d 2$$$.\u003c/p\u003e\u003cp\u003eIn the second test case, the permutation with the maximum cost is $$$[1, 2, 4, 3]$$$. The cost is equal to $$$1 \\cdot 1 + 2 \\cdot 2 + 4 \\cdot 3 + 3 \\cdot 4 - 4 \\cdot 3 \u003d 17$$$.\u003c/p\u003e"}}]}