PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#CCBCHBAHAI0000030. Dịch trái một vị trí (Cyclic Left Shift by One)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Dịch trái một vị trí (Cyclic Left Shift by One)
Dịch trái một vị trí (Cyclic Left Shift by One)
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given an integer array .
Perform one cyclic left shift: the first element moves to the end, and every other element moves one position to the left.
Let the resulting array be . For ,
and
For , the array is unchanged.
Print .
Input
The first line contains integer . The second line contains space-separated integers .
Output
Print the elements after one cyclic left shift on one line.
Subtasks
Subtask 1 (100 points): ; .
Example
Input
5
10 20 30 40 50
Output
20 30 40 50 10
Explanation
Elements at positions through move one position left, while moves to the end.