直接模拟即可
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
int n,last;
cin>>n;
int res=-1;
n--;
cin>>last;
while(n--){
int x;
cin>>x;
res=max(res,abs(last-x));
last=x;
}
cout<<res<<endl;
return 0;
}