{"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":"HTML","content":"\u003cp\u003eAshraf has an array he wants to get a subsequence with minimum cost.\u003c/p\u003e\n\n\u003cp\u003eThe cost of the subsequence is the minimum between:\nThe maximum among all elements at odd indices of s and The maximum among all elements at even indices of s.\u003c/p\u003e\n\n\u003cp\u003eA subsequence is defined as a sequence that can be obtained from a by deleting some elements (possibly none), without changing the order of the remaining elements.\n\u003c/p\u003e\n\u003cp\u003eFor example, the cost of {7,5,6} is min(max(7,6),max(5))\u003dmin(7,5)\u003d5.\u003c/p\u003e\n\n\u003cp\u003eHelp him find the minimum cost of a subsequence of size k.\u003c/p\u003e\n"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains two integers n and k (2≤k≤n≤2⋅105) — the size of the array a and the size of the subsequence.\u003c/p\u003e\n\n\u003cp\u003eThe next line contains n integers a1,a2,…,an (1≤ai≤109) — the elements of the array a.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Output a single integer — the minimum cost of a subsequence of size k."}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e4 2\n1 2 3 4\n\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e1\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e4 3\n1 2 3 4\n\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e2\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e5 3\n5 3 4 2 6\n\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e2\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e6 4\n5 3 50 2 4 5\n\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e3\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test, consider the subsequence s \u003d {1,3}. Here the cost is equal to min(max(1),max(3))\u003d1.\u003c/p\u003e\n\n\u003cp\u003eIn the second test, consider the subsequence s \u003d {1,2,4}. Here the cost is equal to min(max(1,4),max(2))\u003d2.\u003c/p\u003e\n\n\u003cp\u003eIn the fourth test, consider the subsequence s \u003d {3,50,2,4}. Here the cost is equal to min(max(3,2),max(50,4))\u003d3.\u003c/p\u003e"}}]}