int a[N];
void solve() {
int n = read(), k = read();
int cnt = 0;
bool flg = false; // 是否要翻转
int st = 1;
while (cnt != n) {
while (a[st]) ++ st;
int now = st;
vector<int> pos;
while (now <= n) {
pos.push_back(now);
now += k;
}
if (flg) reverse(pos.begin(), pos.end());
for (int &t : pos) a[t] = ++ cnt;
flg ^= 1;
}
wel(a + 1, a + n + 1);
fup (i, 1, n) a[i] = 0;
return;
}