#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=998244353; const double PI=acos(-1); int main(){ int N, K; cin>>N>>K; vector A(N); for(int i=0;i>A[i]; vector p(N,-1); queue que; int idxn=N-1,idx0=0; for(int i=0;i+1A[i+1] while(!que.empty()){ while(p[idx0]!=-1){ idx0++; } int v=que.front(); p[idx0]=v; que.pop(); idx0++; } } } for(int i=0;i ans; for(int i=0;i