Every element must move up by k or down by k — exactly once. Make the gap between the largest and smallest as small as possible.
Every element must move up by k or down by k — exactly once. Make the gap between the largest and smallest as small as possible.
Opens with the full question.