{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eFor this problem, you will write a program that reads in a sequence of 32-bit signed integers. After each \u003ci\u003eodd-indexed\u003c/i\u003e value is read, output the median (middle value) of the elements received so far.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. The first line of each data set contains the data set number, followed by a space, followed by an odd decimal integer M, (1 ≤ M ≤ 9999), giving the total number of signed integers to be processed.\u003cbr\u003eThe remaining line(s) in the dataset consists of the values, 10 per line, separated by a single space.\u003cbr\u003eThe last line in the dataset may contain less than 10 values."}},{"title":"Output","value":{"format":"HTML","content":"For each data set the first line of output contains the data set number, a single space and the number of medians output (which should be one-half the number of input values plus one). The output medians will be on the following lines, 10 per line separated by a single space. The last line may have less than 10 elements, but at least 1 element. There should be no blank lines in the output."}},{"title":"Sample","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\u003e3\r\n1 9\r\n1 2 3 4 5 6 7 8 9\r\n2 9\r\n9 8 7 6 5 4 3 2 1\r\n3 23\r\n23 41 13 22 -3 24 -31 -11 -8 -7\r\n3 5 103 211 -311 -45 -67 -73 -81 -99\r\n-33 24 56\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 5\r\n1 2 3 4 5\r\n2 5\r\n9 8 7 6 5\r\n3 12\r\n23 23 22 22 13 3 5 5 3 -3\r\n-7 -3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}