#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   const long long sze = 1e5 + 2;   const long long inf = 0x3f3f3f3f;   void solve() {     long long n, k;     cin >> n;     cin >> k;     long long swap = k;     long long last = n;     long long i = 1;     bool turn = true;     while (swap) {       if (turn) {         cout << i <<    ;         i++;         turn = false;       } else {         cout << last <<    ;         last--;         turn = true;       }       swap--;     }     if (k % 2 == 0) {       while (last >= i) {         cout << last <<    ;         last--;       }       return;     }     while (i <= last) {       cout << i <<    ;       i++;     }   }   signed main() {     long long test = 1;     while (test--) {       solve();     }     return 0;   }   