Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N, R = map(int, input().split())
- sl = input().split()
- first = R % len(sl)
- last = (len(sl) - 1 + R) % len(sl)
- print(sl[first], sl[last])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement