{"trustable":false,"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":"Description","value":{"format":"MD","content":"\u003cfont face\u003d微软雅黑\u003e\n\n给定一个由整数组成的序列 `x[1], x[2], x[3], ..., x[n]`,请试着从中找出一段区间`[a, b]`使得:\n\n 1. `[a, b]` 间的数字所组成的序列左右对称(形成回文)。\n 2. 对于 `k \u003d (a+b)/2`(若 `a+b` 为奇数则向下取整),`[a, k]` 为不下降序列,(即满足 `x[a] \u003c\u003d x[a+1] \u003c\u003d ... \u003c\u003d x[k]` )。\n 3. `[a, b]` 间的数字应尽可能地多。\n\n你只需输出你找到的 `[a, b]` 所包含的数的个数。"}},{"title":"输入","value":{"format":"MD","content":"\u003cfont face\u003d微软雅黑\u003e\n\n第一行包含一个整数 `T`,表示总共有 `T` 组测试数据 `( T \u003c\u003d 20 )`。\n每组数据首先是一个整数 `n ( 1 \u003c\u003d n \u003c\u003d 100000 )`,表示序列的整数个数,接下来一行输入`n`个整数 `x[1], x[2], x[3] .. x[n] ( 50 \u003c\u003d x[i] \u003c\u003d 250 )`,表示序列中从左到右的这 `n` 个数。"}},{"title":"输出","value":{"format":"MD","content":"\u003cfont face\u003d微软雅黑\u003e\n对于每组数据,输出一行,即你找到的 `[a, b]` 间数的个数。"}},{"title":"样例输入","value":{"format":"MD","content":"2\n4\n100 110 100 70\n5\n40 80 90 90 80"}},{"title":"样例输出","value":{"format":"MD","content":"3\n4"}},{"title":"样例解释","value":{"format":"MD","content":"\u003cfont face\u003d微软雅黑\u003e\n对于第一组数据:\n区间 `[1, 3]` 中的数 `100 110 100` 构成的序列左右对称;且对于 `k \u003d (1+3)/2 \u003d 2` 满足 `x[1] \u003c\u003d x[2]`;并且包含了 3 个数字,已经是所有满足前两个条件的区间中数字最多的了。\n对于第二组数据:\n区间 `[2, 5]` 中的数 `80 90 90 80` 构成的序列左右对称;且对于 `k \u003d (2+5)/2 \u003d 3` 满足 `x[2] \u003c\u003d x[3]`;并且包含了 4 个数字,已经是所有满足前两个条件的区间中数字最多的了。 "}}]}