CF479B Towers
Description
As you know, all the kids in Berland love playing with cubes. Little Petya has $ n $ towers consisting of cubes of the same size. Tower with number $ i $ consists of $ a_{i} $ cubes stacked one on top of the other. Petya defines the instability of a set of towers as a value equal to the difference between the heights of the highest and the lowest of the towers. For example, if Petya built five cube towers with heights (8, 3, 2, 6, 3), the instability of this set is equal to 6 (the highest tower has height 8, the lowest one has height 2).
The boy wants the instability of his set of towers to be as low as possible. All he can do is to perform the following operation several times: take the top cube from some tower and put it on top of some other tower of his set. Please note that Petya would never put the cube on the same tower from which it was removed because he thinks it's a waste of time.
Before going to school, the boy will have time to perform no more than $ k $ such operations. Petya does not want to be late for class, so you have to help him accomplish this task.
Input Format
As you know, all the kids in Berland love playing with cubes. Little Petya has $ n $ towers consisting of cubes of the same size. Tower with number $ i $ consists of $ a_{i} $ cubes stacked one on top of the other. Petya defines the instability of a set of towers as a value equal to the difference between the heights of the highest and the lowest of the towers. For example, if Petya built five cube towers with heights (8, 3, 2, 6, 3), the instability of this set is equal to 6 (the highest tower has height 8, the lowest one has height 2).
The boy wants the instability of his set of towers to be as low as possible. All he can do is to perform the following operation several times: take the top cube from some tower and put it on top of some other tower of his set. Please note that Petya would never put the cube on the same tower from which it was removed because he thinks it's a waste of time.
Before going to school, the boy will have time to perform no more than $ k $ such operations. Petya does not want to be late for class, so you have to help him accomplish this task.
Output Format
In the first line print two space-separated non-negative integers $ s $ and $ m $ ( $ m
Explanation/Hint
In the first sample you need to move the cubes two times, from the second tower to the third one and from the second one to the first one. Then the heights of the towers are all the same and equal to 6.