{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"\u003ch3\u003e Read problems statements in \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/LTIME13/mandarin/SMPAIR.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eMandarin Chinese \u003c/a\u003e and \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/LTIME13/russian/SMPAIR.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eRussian\u003c/a\u003e.\u003c/h3\u003e\n\n\u003cp\u003eYou are given a sequence \u003cb\u003ea\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ..., a\u003csub\u003eN\u003c/sub\u003e\u003c/b\u003e. Find the smallest possible value of \u003cb\u003ea\u003csub\u003ei\u003c/sub\u003e + a\u003csub\u003ej\u003c/sub\u003e\u003c/b\u003e, where 1 ≤ \u003cb\u003ei\u003c/b\u003e \u003c \u003cb\u003ej\u003c/b\u003e ≤ \u003cb\u003eN\u003c/b\u003e.\u003c/p\u003e\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003eThe first line of the input contains an integer \u003cb\u003eT\u003c/b\u003e denoting the number of test cases. The description of \u003cb\u003eT\u003c/b\u003e test cases follows. \u003c/p\u003e\n\u003cp\u003eThe first line of each description consists of a single integer \u003cb\u003eN\u003c/b\u003e.\u003c/p\u003e\n\u003cp\u003eThe second line of each description contains \u003cb\u003eN\u003c/b\u003e space separated integers - \u003cb\u003ea\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ..., a\u003csub\u003eN\u003c/sub\u003e\u003c/b\u003e respectively.\n\n\u003c/p\u003e\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eFor each test case, output a single line containing a single integer - the smallest possible sum for the corresponding test case.\u003c/p\u003e\n\n\u003ch3\u003eConstraints\u003c/h3\u003e\n\u003cp\u003e\n\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eT\u003c/b\u003e \u003d \u003cb\u003e10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e, \u003cb\u003eN\u003c/b\u003e \u003d \u003cb\u003e2\u003c/b\u003e : 13 points.\u003c/li\u003e\n\u003cli\u003e\u003cb\u003eT\u003c/b\u003e \u003d \u003cb\u003e10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e, \u003cb\u003e2\u003c/b\u003e ≤ \u003cb\u003eN\u003c/b\u003e ≤ \u003cb\u003e10\u003c/b\u003e : 16 points.\u003c/li\u003e\n\u003cli\u003e\u003cb\u003eT\u003c/b\u003e \u003d \u003cb\u003e1000\u003c/b\u003e, \u003cb\u003e2\u003c/b\u003e ≤ \u003cb\u003eN\u003c/b\u003e ≤ \u003cb\u003e100\u003c/b\u003e : 31 points.\u003c/li\u003e\n\u003cli\u003e\u003cb\u003eT\u003c/b\u003e \u003d \u003cb\u003e10\u003c/b\u003e, \u003cb\u003e2\u003c/b\u003e ≤ \u003cb\u003eN\u003c/b\u003e ≤ \u003cb\u003e10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e : 40 points.\u003c/li\u003e\n\u003cli\u003e\u003cb\u003e1\u003c/b\u003e ≤ \u003cb\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e ≤ \u003cb\u003e10\u003csup\u003e6\u003c/sup\u003e\u003c/b\u003e\u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"Sample 1","value":{"format":"MD","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\u003e1\n4\n5 1 3 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eHere we pick \u003cb\u003ea\u003csub\u003e2\u003c/sub\u003e\u003c/b\u003e and \u003cb\u003ea\u003csub\u003e3\u003c/sub\u003e\u003c/b\u003e. Their sum equals to 1 + 3 \u003d 4.\u003c/p\u003e"}}]}