给一个长度为n的序列,然后我们找一对数使得Ai-Aj的值最大并且i
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(){int T,n;
scanf("%d",&T);
while(T--){
scanf("%d",&n);int ans=-2147483647,maxn=-214748364,tmp;
for(register int i=1;i<=n;i++){scanf("%d",&tmp);ans=max(ans,maxn-tmp);maxn=max(maxn,tmp);}
printf("%d\n",ans);
}
return 0;
}