#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef bitset<16> BS; const ll MOD = 1E+09 + 7; const ll INF = 1E18; const int MAX_N = 1E+05; int N, K; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> K; int a = 0; for (int i = 1; i <= N - K - 2; i++) { if (i & 1) { a = 1 + (i - 1) / 2; cout << a << " "; } else { a = 3 + (i - 2) / 2; cout << a << " "; } //cout << "i = " << i << ",a = " << a << "\n"; } for (int i = N - K - 1; i <= N; i++) { if (i == N - K - 1) { cout << a + 2 << " "; } else if (i == N - K) { cout << a + 1 << " "; } else { cout << a + 1 << " "; } } cout << "\n"; /* for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n"; } } */ return 0; }