#include #include using namespace std; bool exs[1<<17]; int N,K1,K2; int dis[1<<17]; main() { cin>>N>>K1>>K2; if(K1>Q; priority_queue >P1,P2; for(int i=1;i<=N;i++) { P1.push(make_pair(dis[i],i)); } priority_queue >X; for(int ccc=0;ccc>A>>B; while(!X.empty()&&(-X.top().first=N)) { int id=X.top().second; if(-X.top().first>A)A=-X.top().first; X.pop(); exs[id]=false; for(int j=id-1;j<=id+1;j++) { if(j<1||j>N)continue; if(!exs[j-1]&&!exs[j]&&!exs[j+1]) { P1.push(make_pair(dis[j],j)); } else if(j==id)P2.push(make_pair(dis[j],j)); } } bool flag=true; while(!P1.empty()) { int id=P1.top().second;P1.pop(); if(exs[id])continue; else if(exs[id-1]||exs[id+1]) { P2.push(make_pair(dis[id],id)); continue; } flag=false; cout<