{"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":"在数轴上给出n个点,a1,a2,……an是这n个点在数轴上的位置,现在要你找到一个位置x,使得f(k,x)是最小的\u003cp\u003e\n求f(k,x)的步骤是\u003cp\u003e\n1,找到一个序列d,d1,d2……dn,di\u003d|ai-x|,也就是说找到的这个序列是表示每个点到x的距离\u003cp\u003e\n2,对d序列进行从小到大排序\u003cp\u003e\n3,d[k+1]就是答案\u003cp\u003e\n如果有多种答案,随意输出一种"}},{"title":"输入","value":{"format":"HTML","content":"首先输入一个t,表示有t次询问,t(1\u003c\u003dt\u003c\u003d2e5) \u003cp\u003e\n接下来输入n,k (1 \u003c \u003d n \u003c \u003d 2e5 , 0 \u003c \u003d k \u003c n ) \u003cp\u003e\n接下来一行输入n个数 a1,a2……an (1\u003c\u003dai\u003c\u003d1e9) \u003cp\u003e\n保证多次询问的n的和不大于2e5 \u003cp\u003e"}},{"title":"输出","value":{"format":"HTML","content":"输出t行,每行一个答案是使得f(k,x)最小的x\u003cp\u003e"}},{"title":"样例","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\u003e3\n3 2\n1 2 5\n2 1\n1 1000000000\n1 0\n4\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\n500000000\n4\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}