#include #if 1 && defined(LOCAL) #include #else #define debug(...) #define line #endif using namespace std; using ll = long long; using ld = long double; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } int main(){ int N; cin>>N; int fi; cin>>fi; vectorA(fi); A[fi-1]++; for(int i=1;i>memo; memo--; A[memo]++; } stackans; int pre=0; for(int i=fi-1;i>=0;i--){ pre+=A[i]; ans.push(pre); } while(!ans.empty()){ int a=ans.top(); ans.pop(); if(ans.empty()){ cout<