#pragma GCC optimize("Ofast") #include using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } const int N=2021; ll dp[N][N]; int re[N][N]; bool chmax(ll &x,ll y){ if(x<=y){ x=y; return true; } return false; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,m; cin >> n >> m; vector a(n); for(int i=0;i> a[i]; } a.push_back(0); n++; for(int i=0;i v; // for(int i=0;i<=n;i++){ // for(int j=0;j<=m;j++){ // cout << i << "," << j << endl; // cout << dp[i][j] << " " << re[i][j] << endl; // } // } for(int i=m;i>0;i--){ v.push_back(re[n][i]); n=re[n][i]; } for(int i:v){ cout << i << "\n"; } }