#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; ll dp[2020][2020]; const ll INF=1e18; pair G[2020][2020]; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n,m; cin>>n>>m; vector A(n+1); rep(i,n) cin>>A[i+1]; rep(i,2020){ rep(j,2020) dp[i][j]=-INF; } dp[0][0]=0; dp[0][1]=0; for(int i=1;i<=n;i++){ for(int j=0;j<=m;j++){ int d; if(j%2==0) d=1; else d=-1; if(dp[i-1][j]!=-INF){ if(dp[i][j]0 && dp[i][j] C; int x=n,y=num; while(1){ int tx=G[x][y].first; int ty=G[x][y].second; if(ty!=y) C.push_back(x); x=tx,y=ty; if(x==0){ if(y==1) C.push_back(0); break; } } int l=C.size(); rep(i,l) cout<