#include using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); int n, k; cin >> n >> k; int num = n - k - 2; if (num == 0) { for (int i = 0; i < n; i++) { cout << 1 << ' '; } cout << '\n'; } else { vector res; res.push_back(1); res.push_back(3); res.push_back(2); num -= 1; int idx = 3; while (idx < n) { if (num == 0) { res.push_back(res[idx - 1]); idx++; } else { if (idx % 2 == 1) { res.push_back(res[idx - 1] + 2); idx++; } else { res.push_back(res[idx - 1] - 1); idx++; } num--; } } for (int i = 0; i < n; i++) { cout << res[i] << ' '; } cout << '\n'; } return 0; }