#include using namespace std; #define rep(i,n) for (long long i=0;i<(long long)(n);i++) #define all(v) v.begin(),v.end() using ll=long long; using pll=pair; using tll=tuple; const ll INF=(1ll<<60); template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a a,ans; void f(ll x){ if((n-1-x<=k&&a[x]<=a[x+1])||(k==0&&a[x+1]> n >> k; k--; a.resize(n); rep(i,n) cin >> a[i]; f(0); for(auto &i:ans) cout << i << " "; cout << endl; }