#include #include #include using namespace std; using ll = long long; int f(vector a){ int n=a.size(); vector len(2, vector(n)); for(int i=0; i<2; i++){ vector dp(n, 2e9); for(int j=0; j> n; vector a(n); for(auto&x:a) cin >> x; int ans=0; for(int i=0; i<2; i++){ ans=max(ans, f(a)); for(auto&x:a) x*=-1; } cout << ans << endl; return 0; }