fork download
  1. n, k= map(int, input().split())
  2. liczby=list(map(int, input().split()))
  3. wynik=liczby[-k:]+liczby[:-k]
  4. print(wynik)
Success #stdin #stdout 0.09s 14052KB
stdin
5 3
1 2 3 4 5
stdout
[3, 4, 5, 1, 2]