{"trustable":true,"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":"\r\n\u003csection\u003e\r\n\u003cp\u003eWe have a pyramid with \u003cvar\u003e\\(N\\)\u003c/var\u003e steps, built with blocks.\r\nThe steps are numbered \u003cvar\u003e\\(1\\)\u003c/var\u003e through \u003cvar\u003e\\(N\\)\u003c/var\u003e from top to bottom.\r\nFor each \u003cvar\u003e\\(1≤i≤N\\)\u003c/var\u003e, step \u003cvar\u003e\\(i\\)\u003c/var\u003e consists of \u003cvar\u003e\\(2i-1\\)\u003c/var\u003e blocks aligned horizontally.\r\nThe pyramid is built so that the blocks at the centers of the steps are aligned vertically.\u003c/p\u003e\r\n\u003cdiv style\u003d\"text-align: center;\"\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/a380ad8fd7fd80f523a961ae459427a8?v\u003d1715966637\"\u003e\r\n\u003cp\u003eA pyramid with \u003cvar\u003e\\(N\u003d4\\)\u003c/var\u003e steps\u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cp\u003eSnuke wrote a permutation of (\u003cvar\u003e\\(1\\)\u003c/var\u003e, \u003cvar\u003e\\(2\\)\u003c/var\u003e, \u003cvar\u003e\\(...\\)\u003c/var\u003e, \u003cvar\u003e\\(2N-1\\)\u003c/var\u003e) into the blocks of step \u003cvar\u003e\\(N\\)\u003c/var\u003e.\r\nThen, he wrote integers into all remaining blocks, under the following rule:\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eThe integer written into a block \u003cvar\u003e\\(b\\)\u003c/var\u003e must be equal to the median of the three integers written into the three blocks directly under \u003cvar\u003e\\(b\\)\u003c/var\u003e, or to the lower left or lower right of \u003cvar\u003e\\(b\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cdiv style\u003d\"text-align: center;\"\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/b7c94805626efa15c3eef38913e87c3e?v\u003d1715966637\"\u003e\r\n\u003cp\u003eWriting integers into the blocks\u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cp\u003eAfterwards, he erased all integers written into the blocks.\r\nNow, he only remembers that the permutation written into the blocks of step \u003cvar\u003e\\(N\\)\u003c/var\u003e was (\u003cvar\u003e\\(a_1\\)\u003c/var\u003e, \u003cvar\u003e\\(a_2\\)\u003c/var\u003e, \u003cvar\u003e\\(...\\)\u003c/var\u003e, \u003cvar\u003e\\(a_{2N-1}\\)\u003c/var\u003e).\u003c/p\u003e\r\n\u003cp\u003eFind the integer written into the block of step \u003cvar\u003e\\(1\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Constraints","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cul\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(2≤N≤10^5\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e(\u003cvar\u003e\\(a_1\\)\u003c/var\u003e, \u003cvar\u003e\\(a_2\\)\u003c/var\u003e, \u003cvar\u003e\\(...\\)\u003c/var\u003e, \u003cvar\u003e\\(a_{2N-1}\\)\u003c/var\u003e) is a permutation of (\u003cvar\u003e\\(1\\)\u003c/var\u003e, \u003cvar\u003e\\(2\\)\u003c/var\u003e, \u003cvar\u003e\\(...\\)\u003c/var\u003e, \u003cvar\u003e\\(2N-1\\)\u003c/var\u003e).\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Input","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eThe input is given from Standard Input in the following format:\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(a_1\\)\u003c/var\u003e \u003cvar\u003e\\(a_2\\)\u003c/var\u003e \u003cvar\u003e\\(...\\)\u003c/var\u003e \u003cvar\u003e\\(a_{2N-1}\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003ePrint the integer written into the block of step \u003cvar\u003e\\(1\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 1","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\u003e4\r\n1 6 3 7 4 5 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eThis case corresponds to the figure in the problem statement.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 2","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\n1 2 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\u003c/section\u003e\r\n"}}]}