t = int(input())for _ in range(t): n = int(input()) a = list(map(int, input().split())) a.sort() min_a = a[0] diff = a[1] - a[0] print(max(min_a, diff))
3 3 5 7 9 2 2 3 7 11 74 5 22 52 97 82
5 2 6
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!