PalAndInConsistency

4.8

5 votes
Easy
Problem

Pal loves coding. He solves problems daily on online judges and participates in college OPCs. He keeps track of time he spents on coding everyday.

But Pal is inconsistent. Some day he codes for 1000 units of time and other day he may code for 1 unit of time. Now inconsistency in Pal's case is defined as difference of coding times of any two days. Pal wishes to find his minimum inconsistency.

You will be given coding time of Pal for n days. You have to find minimum inconsistency.

Input:-

First line contains number of test cases t.Each test case begins with number of days n. The next line contains coding times for n days.

Output:-

Print minimum inconsistency per test case.

Constraints:-

t<=20

n<=1000000

coding time for each day<=10000000

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?