{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eAs we all know, Honk has $n$ pools, numbered as $1$ ~ $n$ . There is $a_i$ liters water in the $i$-th pool. Every day, Honk will perform the following operations in sequence.\u003c/p\u003e\n\u003col\u003e\n \u003cli\u003e\u003cp\u003eFind the pool with the most water (If there are more than one, choose one at random) and take one liter of water.\u003c/p\u003e\u003c/li\u003e\n \u003cli\u003e\u003cp\u003eFind the pool with the least water (If there are more than one, choose one at random) and pour one liter of water into the pool.\u003c/p\u003e\u003c/li\u003e\n \u003cli\u003e\u003cp\u003eGo home and rest (Waiting for the next day).\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003ePlease calculate the difference between the amount of water in the pool with the most water and the amount of water in the pool with the least water after the $k$ days.\u003c/p\u003e\n\u003ch2\u003eInput\u003c/h2\u003e\n\u003cp\u003eThe input consists of multiple test cases. The input is terminated by the end of file.\u003cb\u003eThe number of data sets will not exceed 40\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003eThe first line of each test case contains two integers $n$ and $k$, which indicate the number of pools and the number of days to operate the pool.\u003c/p\u003e\n\u003cp\u003eThe second line of each test case contains $n$ integers, and the $i$-th number represent $a_i$ indicating the initial amount of water in the $i$-th pool.\u003c/p\u003e\n\u003cp\u003e$1 \\le n \\le 500000$, $1 \\le k \\le 10^9$, $1 \\le a_i \\le 10^9$.\u003c/p\u003e\n\u003ch2\u003eOutput\u003c/h2\u003e\n\u003cp\u003eFor each test case, print one line containing the answer described above.\u003c/p\u003e"}},{"title":"Sample 1","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\u003e4 100\n1 1 10 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}},{"title":"Sample 2","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\u003e4 3\n2 2 2 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}