{"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\"\u003e 吉哥又想出了一个新的完美队形游戏!\u003cbr\u003e 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形:\u003cbr\u003e\u003cbr\u003e 1、挑出的人保持原队形的相对顺序不变,且必须都是在原队形中连续的;\u003cbr\u003e 2、左右对称,假设有m个人形成新的队形,则第1个人和第m个人身高相同,第2个人和第m-1个人身高相同,依此类推,当然如果m是奇数,中间那个人可以任意;\u003cbr\u003e 3、从左到中间那个人,身高需保证不下降,如果用H表示新队形的高度,则H[1] \u0026lt;\u003d H[2] \u0026lt;\u003d H[3] .... \u0026lt;\u003d H[mid]。\u003cbr\u003e\u003cbr\u003e 现在吉哥想知道:最多能选出多少人组成新的完美队形呢? \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":" 输入数据第一行包含一个整数T,表示总共有T组测试数据(T \u0026lt;\u003d 20);\u003cbr\u003e 每组数据首先是一个整数n(1 \u0026lt;\u003d n \u0026lt;\u003d 100000),表示原先队形的人数,接下来一行输入n个整数,表示原队形从左到右站的人的身高(50 \u0026lt;\u003d h \u0026lt;\u003d 250,不排除特别矮小和高大的)。"}},{"title":"Output","value":{"format":"HTML","content":" 请输出能组成完美队形的最多人数,每组输出占一行。"}},{"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\u003e2\r\n3\r\n51 52 51\r\n4\r\n51 52 52 51\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}