IntermediateRating 1300
Make Every Value Unique
In one move you add 1 to any number. Print the fewest moves to make all numbers different.
Input
n, then n integers.
Output
One integer.
Sample 1
Input
3 1 2 2
Output
1
Sample 2
Input
6 3 2 1 2 1 7
Output
6
Output appears here