2024年10月8日 星期二

定時K彈


 N = int(input())

M = int(input())

p = list(range(1,N+1))


c = 1

while len(p)>1:

    if c%2 != 0:

        p.append(p[0])

    p.remove(p[0])

    c +=1

print(p)


沒有留言:

張貼留言