{"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\"\u003eYou are given an array $a$ of length $n$. You must perform exactly $k$ times operations. \u003cbr\u003e\u003cbr\u003eFor each operation, \u003cbr\u003e\u003cbr\u003e$\\bullet$ First, you select two integers $l,r$ $($$1\\leq l\\leq r \\leq n$$)$,\\\\\\\\$\\bullet$ Second, change $a$ to $b$, satisfy :\\\\\\\\$\\ \\ \\ \\ \\circ$ For each $i$ $($$1\\le i\u0026lt; l$$)$ , $b_i\u003da_i$;\\\\\\\\$\\ \\ \\ \\ \\circ$ For each $i$ $($$l\\le i\u0026lt; r$$)$ , $b_i\u003da_{i+1}$;\\\\\\\\$\\ \\ \\ \\ \\circ$ $b_r\u003da_l$\\\\\\\\$\\ \\ \\ \\ \\circ$ For each $i$ $($$r\u0026lt; i\\le n$$)$ , $b_i\u003da_i$;\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eFind the lexicographically largest possible array after $k$ times operations.\u003cbr\u003e\u003cbr\u003eArray $x$ is lexicographically greater than array $y$ if there exists an index $i$ $($ $1\\leq i\\leq n$ $)$ such that $x_i$ $\u0026gt;$ $y_i$ and for every $j (1\\leq j \\lt i) ,$ $ x_j\u003dy_j$.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input contains one integer $T$ $($$1\\leq T\\leq 100$ $)$ --- the number of test cases. Then $T$ test cases follow.\\\\\\\\The first line of the test case contains two integers $n,k$ $($$1\\le n,k\\le 300000$$)$\\\\\\\\The second line of the test case contains $n$ integers $a_1,a_2,...,a_n$$($$1\\le a_i\\le 300000$$)$\u003cbr\u003e\u003cbr\u003eThe sum of $n$ over all testcases doesn\u0027t exceed $10^{6}$.\u003cbr\u003e\u003cbr\u003eThe sum of $k$ over all testcases doesn\u0027t exceed $10^{6}$."}},{"title":"Output","value":{"format":"HTML","content":"For each testcase,one line contains $n$ integers ,$a_1,a_2,...,a_n$ --- the lexicographically largest possible array after $k$ times operations.\u003cbr\u003e\u003cbr\u003e**Don‘t have spaces at the end of the line**\u003cbr\u003e"}},{"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\u003e2\r\n7 3\r\n1 4 2 1 4 2 4\r\n5 2\r\n4 3 5 4 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4 4 2 4 2 1 1\r\n5 4 5 4 3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}