{"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":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003eAfter millennia of waiting, the Intergalactic Races to determine the fastest being throughout the universe, are going to begin! (Why is the concept of time the same on other planets? A mystery for the ages indeed). \u003c/p\u003e\n\u003cp\u003eParticipant number 1729 fancies itself to be the most intelligent being there, and wants to win the race for its own reasons. However, 1729 also doesn\u0027t wish to stand out right from the start (Why, you ask? That\u0027s classified information). \u003c/p\u003e\n\u003cp\u003eThe preliminaries are simply a straight dash, from start to finish. It has been announced that the fastest k+1 participants will be selected for the next round. 1729 used its amazing mental abilities to gauge the speed of the other participants in its block, and now knows exactly how much time they will take to complete the race.\u003c/p\u003e\n\u003cp\u003eSince 1729 doesn\u0027t want to stand out, it wants to end the race in (k+1)th place. However, the Race has a single, weird rule - if more than k+1 participants can be chosen, everyone is disqualified. 1729 wants to avoid this happening at all cost. It also wants to take an integer amount of time, and not take more than 10\u003csup\u003e9\u003c/sup\u003e units of time to finish the race - that would just be disgraceful.\u003c/p\u003e\n\u003cp\u003eHow much time would 1729 take to finish the race?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of input contains two integers n and k (1 ≤ n ≤ 2*10\u003csup\u003e5\u003c/sup\u003e, 0 ≤ k ≤ n). The second line of input contains n integers a\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ..., a\u003csub\u003en\u003c/sub\u003e (1 ≤ a\u003csub\u003ei\u003c/sub\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e) — the times of the other participants.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint any integer x in the range [1, 10\u003csup\u003e9\u003c/sup\u003e] such that by finishing the race in exactly x seconds, 1729 will be (k+1)th. Further, there must be exactly k+1 participants whose time taken is ≤ x, to avoid disqualification.\u003c/p\u003e\n\u003cp\u003eIf there are multiple possible options, print any one - it doesn\u0027t matter which. But print exactly one.\u003c/p\u003e\n\u003cp\u003eIf there are no possible options, print -1.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":" \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e7 4\u003cbr\u003e3 7 4 1 15 3 240\u003cbr\u003e\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\u003e6\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\u003e7 1\u003cbr\u003e3 7 5 15 10 3 240\u003cbr\u003e\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\u003e-1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example, 4 and 5 are also valid times - this is easy to check.\u003c/p\u003e\n\u003cp\u003eIn the second example, if x \u003d 1 or 2, 1729 will finish 1st, which is not what he wants. If x \u003e 3 then 1729 will not be in the top 2. If x \u003d 3, 3 participants will be chosen, which will lead to disqualification. Hence, there is no valid time.\u003c/p\u003e"}}]}