#include #include using namespace std; const int maxn=100005; const int oo=1e9+7; int n,x; int idx[maxn],dp[maxn]; int main() { scanf("%d",&n); for(int i=0;i