You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
302 B

#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
int n, mx, pre, nxt;
int main() {
cin >> n >> pre;
for (int i = 2; i <= n; i++) {
cin >> nxt;
if (abs(nxt - pre) > mx) mx = abs(nxt - pre);
pre = nxt;
}
cout << mx;
return 0;
}