• + 1 comment

    Here is another Python Solution:-

    n,k,q = input().strip().split(' ') n,k,q = [int(n),int(k),int(q)] a = [int(a_temp) for a_temp in input().strip().split(' ')]

    for i in range(q): m = int(input().strip()) print(a[(m-k)%len(a)])