#include #include using namespace std; const int oo=1e9; const int maxn=10005; int n; int a[maxn],dp[maxn],f1[maxn],f2[maxn]; void DP(int *f) { fill(dp,dp+maxn,oo); for(int i=0;i