-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB. Honest Coach.cpp
More file actions
59 lines (46 loc) · 1.24 KB
/
B. Honest Coach.cpp
File metadata and controls
59 lines (46 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;
///#define ff first
///#define ss second
///#define pb push_back
///#define all(v) v.begin(),v.end()
///#define D(x) cerr << #x " = " << x << '\n'
///#define DBG cerr << "Hi!" << '\n'
///#define CLR(a) memset(a,0,sizeof(a))
///#define SET(a) memset(a,-1,sizeof(a))
///#define nn "\n"
///#define gcd(a,b) __gcd(a,b)
///#define lcm(a,b) (a*b)/gcd(a,b)
///#define pi acos(-1.0)
#define inf 2e9+10
//const double pi = acos(-1.0);
//const double eps = 1e-8;
void solve(){
int t;
cin>>t;
while(t--){
int n,arr[1000],mn=inf;
cin>>n;
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
for(int i=n-1;i>0;i--){
int x=arr[i]-arr[i-1];
mn=min(mn,x);
}
cout<<mn<<"\n";
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
//freopen("in.txt", "r", stdin);
solve();
return 0;
}