#include using namespace std; typedef long long ll; typedef pair P; #define MAX_N 200005 vector X; ll N,K; ll a[MAX_N],b[MAX_N]; ll c[MAX_N]; P d[MAX_N]; ll INF = (1LL<<60); ll tree[500]; ll getMax(int l,int r){ ll res=-INF; int i=l; while(i0) assert(a[i]>a[i-1]); } X.push_back( INF ); for(int i=0;i