You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': t = int(input().strip()) for i in range(t): first_multiple_input = input().rstrip().split() n = int(first_multiple_input[0]) k = int(first_multiple_input[1]) p=[] if n%2==0: for i in range(n//2): p.append(n-1-i) p.append(i) else: for i in range(n//2+1): if i==n//2: p.append(n-1-i) break p.append(n-1-i) p.append(i) print(p.index(k))
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse Game
You are viewing a single comment's thread. Return to all comments →