Polycarp got an array of integers a[1…n]a[1…n] as a gift. Now he wants to perform a certain number of operations (possibly zero) so that all elements of the array become the same (that is, to become a1=a2=⋯=ana1=a2=⋯=an).
For example, let a=[4,2,1,6,2]a=[4,2,1,6,2]. He can perform the following operation: select indices 1, 2, and 4 and increase elements of the array in those indices by 11. As a result, in one operation, he can get a new state of the array a=[5,3,1,7,2]a=[5,3,1,7,2].
What is the minimum number of operations it can take so that all elements of the array become equal to each other (that is, to become a1=a2=⋯=ana1=a2=⋯=an)?
The first line of the input contains a single integer tt (1≤t≤1041≤t≤104) — the number of test cases in the test.
The following are desc
The first line of the desc
The second line of the desc
For each test case, print one integer — the minimum number of operations to make all elements of the array aa equal.
3
6
3 4 2 4 1 2
3
1000 1002 998
2
12 11
3
4
1