์์ํ ์กฐ๊ฑด๋ค์ ์๊ฐํ๋ค ํท๊ฐ๋ ค์ 40๋ถ๋ด๋ก ๋ชป ํ์๋คใ
ใ
ใ
..
์กฐ์ํ ์กฐ๊ฑด๋ค์ด ์๋ ๋ฌธ์ ๋ค์ ์ ๋ชป ํธ๋ ๋ฏํ๋ค. ๋ณต์กํ๋ฉด ๋ค์๋ถํฐ๋ ์ ์ด์ผ๊ฒ ๋ค
#include <bits/stdc++.h>
using namespace std;
queue<int> q;
int main(void)
{
cin.tie(0);
ios::sync_with_stdio(0);
int n, k;
cin >> n >> k;
for (int i = 1; i <= n; i++)
q.push(i);
cout << '<';
while (!q.empty())
{
for (int i = 0; i < k - 1; i++)
{
q.push(q.front());
q.pop();
}
cout << q.front();
if (q.size() != 1)
cout << ", ";
q.pop();
}
cout << '>';
return (0);
}