K. Karl's Dormitory Allocation
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
5 2
10 3 7 6 2
Output
3 3 3
Input
5 4
100 20 60 40 50
Output
6 24 0