백준 풀이

백준 11866번 파이썬

ag2개발자 2022. 8. 26. 12:24
from collections import deque
n,k= map(int,input().split())
a=deque()
for i in range(1,n+1):
    a.append(i)
print('<', end='')
while a:
    for j in range(k-1):
        a.append(a[0])
        a.popleft()
    print(a.popleft(), end="")
    if a:
        print(', ', end='')
print('>')

'백준 풀이' 카테고리의 다른 글

백준 11723번 파이썬  (0) 2022.08.26
백준 11651번 파이썬  (0) 2022.08.26
백준 1676번 파이썬  (0) 2022.08.26
백준 10814번 파이썬  (0) 2022.08.26
백준 10815번 파이썬  (0) 2022.08.26