MCPcopy Create free account
hub / github.com/acm-clan/algorithm-stone / main

Function main

user/codeforces/1607C.Minimum Extraction.cpp:7–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5long long n,a[200001],sum=0,mx=-inf;
6
7int main()
8{
9
10 long long t;
11 scanf("%lld",&t);
12 while(t--)
13 {
14 sum=0,mx=-inf;
15 scanf("%lld",&n);
16 for(long long i=1;i<=n;++i) scanf("%lld",&a[i]);
17 sort(a+1,a+1+n);
18 for(long long i=1;i<=n;++i)
19 {
20 a[i]-=sum;
21 sum+=a[i];
22 mx=max(a[i],mx);
23 }
24 printf("%lld\n",mx);
25 }
26 return 0;
27}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected