Guest User

Untitled

a guest
Dec 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. n, d = map(int, input().split()) # n = len(array), d = Number of rotation
  2. values = [i for i in input().split()][:n]
  3. print(" ".join(values[d:] + values[:d])) # left rotation
  4. print(" ".join(values[n-d:] + values[:n-d])) # right rotation
Add Comment
Please, Sign In to add comment