~/algor $ cat problems/array/cyclic-shift-right-by-1
Cyclic shift right by 1
Easy
1000 ms
128 MB
31%
A positive integer and an array of integers are given. Cyclically shift the array elements by position to the right (the last element moves to the first place) and print the resulting array.
Input
The first line contains a positive integer . The second line contains integers separated by spaces.
Output
One line with integers separated by spaces.
Note
Examples
Input #1
5 10 20 30 40 50
Output #1
50 10 20 30 40
Input #2
3 1 2 3
Output #2
3 1 2