from bisect import bisect_left def solve(): n = int(input()) a = list(map(int, input().split(' '))) # print(n,a) ans = 0 for i in range(n-1): ng = -1 ok = int(1e18) while abs(ng-ok) > 1: mid = ng+ok mid //= 2 if a[i] + (i+1)*mid < a[i+1] + (i+2)*mid: ok = mid else: ng = mid # print('ok',ok) ans = max(ans,ok) # print(ans) return ans t = int(input()) for _ in range(t): print(solve())