{"trustable":false,"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":"PLAIN","content":"自从隔离在家,xy已经几天没有吃过零食了。为此,xy的朋友xe为他带来了n块饼干。这些饼干上面刻着1-n的编号,且每一个饼干有着自己的口味,为了方便区分,将编号为i的饼干的口味记作美味值bi,bi越大说明xy越喜欢这个口味的饼干。xy有强迫症,他只会按着编号从小到大的顺序吃这些饼干。xe为了捉弄xy,要求他答应一个条件才会把饼干给他:xy按顺序吃的任意两块相邻的饼干,他们的编号之差必须要等于相应美味值之差。【即,若将xy第i次吃的饼干和第i+1次吃的饼干的编号分别记为n_i和n_{i+1},则bn_i-bn_{i+1}\u003dn_i-n_{i+1}】若xy只吃一块饼干,则不受此约束。现在请问xy吃掉的饼干美味值之和最大为多少"}},{"title":"Input","value":{"format":"PLAIN","content":"第一行一个整数n,[1,2e5]\n第二行有n个整数,第i个整数代表bi,bi的大小为[1,4e5]\n"}},{"title":"Output","value":{"format":"PLAIN","content":"xy吃掉的饼干美味值之和最大为多少"}},{"title":"input1","value":{"format":"PLAIN","content":"6\n11 8 2 10 11 16"}},{"title":"output1","value":{"format":"PLAIN","content":"29"}},{"title":"input2","value":{"format":"PLAIN","content":"1\n10"}},{"title":"output2","value":{"format":"PLAIN","content":"10"}},{"title":"input3","value":{"format":"PLAIN","content":"7\n9 10 27 12 13 30 15"}},{"title":"output3","value":{"format":"PLAIN","content":"59"}}]}