#include typedef long long int ll; using namespace std; int buy_ice(int k, int *box){ int cost = 0; int free = 0; for (int i = 0; i < k; i++){ int ice = box[i]; if (free > 0){ free -= 1; } else { cost += 1; } if (ice == 2){ free += 2; } else if (ice == 1){ free += 1; } } return cost; } int main(){ ll n, k; cin >> n >> k; int box[k]; string ices; cin >> ices; for (int i = 0; i < n; i++){ int ice = ices[i] - '0'; for (int j = 0; i + (n * j) < k; j++){ cout << i + (n * j) << "ngo" << endl; box[i + (n * j)] = ice; } } for (int i = 0; i < k; i++){ cout << box[i] << " "; } int cost = buy_ice(k % n, box); cout << cost << endl; return 0; }