11701170 SUSTech Online Judge
Problem 1170 --Maximum difference

1170: Maximum difference

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1811  Solved: 535
[Submit][Status][Web Board]

Description

Give you n integers a1, a2, … , an. Please find two integers ai and aj (i < j), such that ai – aj is maximum.


Input

The first line of input is the number of test cases T (1 <= T <= 10)

For each test case, the first line will be an integer n (2 <= n <= 200000). Then there are n integers. 0<= ai <= 100000.


Output

For each test case, print the maximum difference.


Sample Input

1
5
1 2 3 4 5

Sample Output

-1

HINT

Source

[Submit][Status]