Skip to content

Commit a832ebd

Browse files
committed
Added 1360B - Honest Coach.cpp
1 parent 8df6838 commit a832ebd

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

1360B - Honest Coach.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
5+
// Code Written By: Vikash Patel
6+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
7+
8+
int main()
9+
{
10+
int t;
11+
cin>>t;
12+
while(t--)
13+
{
14+
int n;
15+
cin>>n;
16+
int s[n];
17+
for(int i=0;i<n;i++)
18+
{
19+
cin>>s[i];
20+
}
21+
int mini = INT_MAX;
22+
for(int i=0;i<n;i++)
23+
{
24+
for(int j=0;j<n;j++)
25+
{
26+
if(i!=j)
27+
{
28+
mini = min(mini,abs(s[i]-s[j]));
29+
}
30+
}
31+
}
32+
cout<<mini<<endl;
33+
}
34+
}

0 commit comments

Comments
 (0)