Scroll indicator done
728x90

https://www.acmicpc.net/problem/11866


n, k = map(int, input().split())
p = list(range(1, n+1))

ans = []
i = k-1
while len(ans) < n-1:
    ans.append(p.pop(i))
    i = (i + k-1) % len(p)
ans.append(p[0])    
print('<'+', '.join(map(str, ans)) + '>')    
728x90

'BAEKJOON > Python' 카테고리의 다른 글

[B1929][소수 구하기][python]  (0) 2021.03.19
[B1654][랜선 자르기][python]  (0) 2021.03.19
[B2164][카드][python]  (0) 2021.03.18
[B10886][덱][python]  (0) 2021.03.18
[B1978][소수 찾기][python]  (0) 2021.03.18