Given array with positive integers. Find the minimum number of operations required so that an Arithmetic Progression with the array elements is achieved with common difference as . In a single operation, any element can be incremented by .
First line contains number . Second line contains positive integers, each is no more than .
Print the minimum number of operations to get an Arithmetic Progression with common difference as .
In the first test array must be converted to . In this case we'll make operations.