We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b519e50 commit 65b9498Copy full SHA for 65b9498
김지호/7주차/260212.py
@@ -0,0 +1,10 @@
1
+n, k = map(int, input().split())
2
+people = list(range(1, n + 1)) #둥글게 모여앉은 사람들
3
+k_index = 0
4
+result = []
5
+
6
+for i in range(n): #n번만 반복하면 되니까
7
+ k_index = (k_index + k - 1) % len(people)
8
+ result.append(people.pop(k_index))
9
10
+print('<' + str(result)[1:-1] + '>')
0 commit comments