【題目敘述】https://zerojudge.tw/ShowProblem?problemid=e970
Python code (credit: Amy Chou)
N = int(input())
R = list(map(int, input().split()))
B = R[-1]
total = 0
for i in range(1, N+1, B):
total += R[i-1]
M = total % N
if M == 0:
M = N
print(M, R[M-1])