MathModel is obsessed with arithmetic sequences. He has an array of positive integers of length . He wants to transform the array into an arithmetic sequence. To do that, he can perform the following operation any number of times:
choose and increase a_i by .
He wants to know the minimum cost to transform his array into an arithmetic sequence.
An arithmetic sequence is an array of length such that a_i = m \cdot i + c for some integers and .
The first line contains a single integer (1 \le t \le 10^4) — the number of test cases.
The first line of each test case contains a single integer (2 \le n \le 2 \cdot 10^5) — the length of the array .
The second line of each test case contains integers a_1, a_2, \ldots, a_n (1 \le a_1, a_2, \ldots, a_n \le 10^9) — the array .
It is guaranteed that the sum of over all test cases does not exceed 2 \cdot 10^5.
For each test case, output a single integer: the minimum number of operations required so that becomes an arithmetic progression.
Example 1
Subtask 1 ( points): n = 3.
Subtask 2 ( points): n \le 10.
Subtask 3 ( points): \sum n \le 500.
Subtask 4 ( points): \sum n \le 2000.
Subtask 5 ( points): a_i \le 10.
Subtask 6 ( points): a_i \le 100.
Subtask 7 ( points): a_i \le 1000.
Subtask 8 ( points): a_i \le 10^6.
Subtask 9 ( points): No additional constraints