#include #include #define LL long long //------------------------------------------------------------ void Max(LL &num1,LL num2) { if (num1num2) num1=num2; } //------------------------------------------------------------ int tcase; int icase; int n; int i,j; LL v[100000]; LL max[100000]; LL min[100000]; //------------------------------------------------------------ int main( ) { for (scanf("%d",&tcase); ++icase<=tcase; ) { //--0 init scanf("%d",&n); for (i=1; i<=n; i++) scanf("%I64d",&v[i]); std::sort(v+1,v+1+n); //--1 for (i=1; i<=n; i++) { max[i]=max[i-1]; Max(max[i],v[i]-max[i-1]); // min[i]=min[i-1]; // Min(min[i],v[i]-max[i-1]); } //--2 printf("%I64d\n",max[n]); } }