{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eVanya has an integer sequence \u003cvar\u003e\\(A\\)\u003c/var\u003e of length \u003cvar\u003e\\(N\\)\u003c/var\u003e.\u003c/p\u003e \n\u003cp\u003eHe will choose an integer \u003cvar\u003e\\(b\\)\u003c/var\u003e at his will. He will get sad if \u003cvar\u003e\\(A_i\\)\u003c/var\u003e and \u003cvar\u003e\\(b+i\\)\u003c/var\u003e are far from each other. More specifically, the \u003cem\u003esadness\u003c/em\u003e of Vanya is calculated as follows:\u003c/p\u003e \n\u003cul\u003e \n \u003cli\u003e\u003cvar\u003e\\(|A_1 - (b+1)| + |A_2 - (b+2)| + ... + |A_N - (b+N)|\\)\u003c/var\u003e\u003c/li\u003e \n\u003c/ul\u003e \n\u003cp\u003eWhere \u003cvar\u003e\\(|x|\\)\u003c/var\u003e represents the absolute value of \u003cvar\u003e\\(x\\)\u003c/var\u003e.\u003c/p\u003e \n\u003cp\u003eFind the best value \u003cvar\u003e\\(b\\)\u003c/var\u003e, such that the sadness of Vanya is minimized.\u003c/p\u003e"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cul\u003e \n \u003cli\u003e\u003cvar\u003e\\(1 \\leq N \\leq 2 \\times 10^5\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1 \\leq A_i \\leq 10^9\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003eAll values in input are integers.\u003c/li\u003e \n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eThe first line contains \u003cvar\u003e\\(N\\)\u003c/var\u003e, followed by a new line with \u003cvar\u003e\\(N\\)\u003c/var\u003e integers:\u003c/p\u003e \n\u003cpre\u003e\n\u003cvar\u003e\\(A_1\\)\u003c/var\u003e \u003cvar\u003e\\(A_2\\)\u003c/var\u003e \u003cvar\u003e\\(...\\)\u003c/var\u003e \u003cvar\u003e\\(A_N\\)\u003c/var\u003e\n\u003c/pre\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003ePrint the minimum possible sadness of Vanya.\u003c/p\u003e"}},{"title":"Sample Input 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e5\n2 2 3 5 5\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e2\n\u003c/pre\u003e \n\u003cp\u003e For \u003cvar\u003e\\(b\u003d0\\)\u003c/var\u003e, the sadness will be \u003cvar\u003e\\(2\\)\u003c/var\u003e. "}},{"title":"Sample Input 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e7\n1 2 3 4 5 6 7\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e0\n\u003c/pre\u003e"}},{"title":"Sample Input 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e6\n6 5 4 3 2 1\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e18\n\u003c/pre\u003e"}}]}