t = int(eval(input()))

for _ in range(t):

    n = int(eval(input()))

    blocks = list(map(int, input().split()))

    ans = [0, 0]

    for i in range(1, n):

        ans[0] = max(ans[0], blocks[i] - blocks[i-1])

        ans[1] = max(ans[1], blocks[i-1] - blocks[i])

    print((*ans))

t = int(eval(input()))

for _ in range(t):

    n = int(eval(input()))

    blocks = list(map(int, input().split()))

    maxv = minv = 0

    for i in range(1, n):

        maxv = max(maxv, blocks[i] - blocks[i-1])

        minv = max(minv, blocks[i-1] - blocks[i])

    print((maxv, minv))



t = int(eval(input()))
for _ in range(t):
    n = int(eval(input()))
    blocks = list(map(int, input().split()))
    ans = [0, 0]
    for i in range(1, n):
        ans[0] = max(ans[0], blocks[i] - blocks[i - 1])
        ans[1] = max(ans[1], blocks[i - 1] - blocks[i])
    print((*ans))

t = int(eval(input()))
for _ in range(t):
    n = int(eval(input()))
    blocks = list(map(int, input().split()))
    maxv = minv = 0
    for i in range(1, n):
        maxv = max(maxv, blocks[i] - blocks[i - 1])
        minv = max(minv, blocks[i - 1] - blocks[i])
    print((maxv, minv))

-    ans = [0, 0] +    maxv = minv = 0 -        ans[0] = max(ans[0], blocks[i] - blocks[i - 1]) -        ans[1] = max(ans[1], blocks[i - 1] - blocks[i]) -    print((*ans)) +        maxv = max(maxv, blocks[i] - blocks[i - 1]) +        minv = max(minv, blocks[i - 1] - blocks[i]) +    print((maxv, minv))