n = int(input())
m = int(input())
lst = [i+1 for i in range(n)]
acc = m
while n > 1 :
while acc > n:
acc -= n
n = n - 1
lst.pop(acc-1)
acc = acc + m - 1
print(lst[0])
欢迎分享,转载请注明来源:内存溢出
n = int(input())
m = int(input())
lst = [i+1 for i in range(n)]
acc = m
while n > 1 :
while acc > n:
acc -= n
n = n - 1
lst.pop(acc-1)
acc = acc + m - 1
print(lst[0])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)