{"trustable":true,"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\u003eThere are $$$n$$$ Christmas trees on an infinite number line. The $$$i$$$-th tree grows at the position $$$x_i$$$. All $$$x_i$$$ are guaranteed to be distinct.\u003c/p\u003e\u003cp\u003eEach \u003cspan class\u003d\"tex-font-style-bf\"\u003einteger\u003c/span\u003e point can be either occupied by the Christmas tree, by the human or not occupied at all. Non-integer points cannot be occupied by anything.\u003c/p\u003e\u003cp\u003eThere are $$$m$$$ people who want to celebrate Christmas. Let $$$y_1, y_2, \\dots, y_m$$$ be the positions of people (note that all values $$$x_1, x_2, \\dots, x_n, y_1, y_2, \\dots, y_m$$$ should be \u003cspan class\u003d\"tex-font-style-bf\"\u003edistinct\u003c/span\u003e and all $$$y_j$$$ should be \u003cspan class\u003d\"tex-font-style-bf\"\u003einteger\u003c/span\u003e). You want to find such an arrangement of people that the value $$$\\sum\\limits_{j\u003d1}^{m}\\min\\limits_{i\u003d1}^{n}|x_i - y_j|$$$ is the minimum possible (in other words, the sum of distances to the nearest Christmas tree for all people should be minimized).\u003c/p\u003e\u003cp\u003eIn other words, let $$$d_j$$$ be the distance from the $$$j$$$-th human to the nearest Christmas tree ($$$d_j \u003d \\min\\limits_{i\u003d1}^{n} |y_j - x_i|$$$). Then you need to choose such positions $$$y_1, y_2, \\dots, y_m$$$ that $$$\\sum\\limits_{j\u003d1}^{m} d_j$$$ is the minimum possible.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains two integers $$$n$$$ and $$$m$$$ ($$$1 \\le n, m \\le 2 \\cdot 10^5$$$) — the number of Christmas trees and the number of people.\u003c/p\u003e\u003cp\u003eThe second line of the input contains $$$n$$$ integers $$$x_1, x_2, \\dots, x_n$$$ ($$$-10^9 \\le x_i \\le 10^9$$$), where $$$x_i$$$ is the position of the $$$i$$$-th Christmas tree. It is guaranteed that all $$$x_i$$$ are distinct.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIn the first line print one integer $$$res$$$ — the minimum possible value of $$$\\sum\\limits_{j\u003d1}^{m}\\min\\limits_{i\u003d1}^{n}|x_i - y_j|$$$ (in other words, the sum of distances to the nearest Christmas tree for all people).\u003c/p\u003e\u003cp\u003eIn the second line print $$$m$$$ integers $$$y_1, y_2, \\dots, y_m$$$ ($$$-2 \\cdot 10^9 \\le y_j \\le 2 \\cdot 10^9$$$), where $$$y_j$$$ is the position of the $$$j$$$-th human. All $$$y_j$$$ should be distinct and all values $$$x_1, x_2, \\dots, x_n, y_1, y_2, \\dots, y_m$$$ should be \u003cspan class\u003d\"tex-font-style-bf\"\u003edistinct\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eIf there are multiple answers, print any of them.\u003c/p\u003e"}},{"title":"Examples","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 6\n1 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8\n-1 2 6 4 0 3 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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 5\n0 3 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e7\n5 -2 4 -1 2 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}