for _ in range(int(input())): n = int(input()) a = list(map(int,input().split())) x = 0 for u,v in zip(a[:-1],a[1:]): x = max(x,u-v+1) print(x)