#C7298. Rotate List
Rotate List
Rotate List
You are given a list of integers and a non-negative integer steps. Your task is to rotate the list to the right by steps positions. If steps is greater than the size of the list, only the effective number of rotations is performed. Note that the effective number of rotations can be computed using the equation $$k = steps \mod n$$, where \(n\) is the number of elements in the list.
Example:
Input: 1 2 3 4 5 2 Output: 4 5 1 2 3
Implement the function to perform this rotation and output the rotated list with space-separated integers.
inputFormat
The input consists of two lines:
- The first line contains space-separated integers representing the list.
- The second line contains an integer steps that indicates the number of positions to rotate the list.
outputFormat
Print a single line containing the rotated list as space-separated integers.
## sample1 2 3 4 5
2
4 5 1 2 3