{"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":"Đề bài","value":{"format":"MD","content":"Gần đây , do sức khỏe giảm sút , Vũ lên kế hoạch chạy bộ của mình trong n ngày. Vũ đưa ra một bản kế hoạch có dạng một dãy số nguyên không âm gồm n số : $a_1$ , $a_2$ , ... , $a_n$ mà theo đó , ngày thứ i Vũ sẽ chạy bộ $a_i$ lần. Theo lời khuyên của chuyên gia sức khỏe, để cải thiện sức khỏe tốt hơn , Vũ quyết định sửa bản kế hoạch sao cho anh ta chạy bộ ít nhất $K$ lần trong mỗi hai ngày liên tiếp bằng cách thêm số lần chạy bộ vào một số ngày , đồng thời đảm bảo tổng số lần chạy bộ thêm vào là ít nhất. Hãy giúp Vũ thực hiện việc đó."}},{"title":"Input","value":{"format":"MD","content":"Dòng đầu tiên là hai số nguyên $n$ , $k$ ($1 \\le n, k \\le 500$).\nDòng thứ hai là n số nguyên $a_1$ , $a_2$ , ... , $a_n$ ($1 \\le a_i \\le 500$)."}},{"title":"Output","value":{"format":"MD","content":"Dòng đầu tiên là số lần chạy bộ ít nhất cần thêm vào kế hoạch.\nDòng thứ hai gồm n số nguyên $b_1$ , $b_2$ , ... , $b_n$ mô tả bản kế hoạch sau khi chỉnh sửa. Nếu có bản kế hoạch thỏa mãn , in ra bản bất kì."}},{"title":"Ví dụ 1","value":{"format":"MD","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\n2 0 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n2 3 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Ví dụ 2","value":{"format":"MD","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 1\n0 0 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n0 1 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Ví dụ 3","value":{"format":"MD","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\u003e4 6\n2 4 3 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n2 4 3 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}