Sample Input Sample Output 1 45 1 2 3 5 2 1 2 3 4 5 Explanation Here Tis 1, which means one test case. denoting the number of elements in the array and , denoting the number of steps of rotations. The...


Sample Input<br>Sample Output<br>1<br>45 1 2 3<br>5 2<br>1 2 3 4 5<br>Explanation<br>Here Tis 1, which means one test case.<br>denoting the number of elements in the array and , denoting the<br>number of steps of rotations.<br>The initial array is:<br>In first rotation, 5 will come in the first position and all other<br>elements will move to one position ahead from their current<br>position. Now, the resultant array will be<br>In second rotation, 4 will come in the first position and all other<br>elements will move to one position ahead from their current<br>position. Now, the resultant array will be<br>

Extracted text: Sample Input Sample Output 1 45 1 2 3 5 2 1 2 3 4 5 Explanation Here Tis 1, which means one test case. denoting the number of elements in the array and , denoting the number of steps of rotations. The initial array is: In first rotation, 5 will come in the first position and all other elements will move to one position ahead from their current position. Now, the resultant array will be In second rotation, 4 will come in the first position and all other elements will move to one position ahead from their current position. Now, the resultant array will be
Input:<br>The first line will consists of one integer T denoting the number of<br>test cases.<br>For each test case:<br>1) The first line consists of two integers N and K, N being the<br>number of elements in the array and K denotes the number of<br>steps of rotation.<br>2) The next line consists of N space separated integers, denoting<br>the elements of the array A.<br>Output:<br>Print the required array.<br>Constraints:<br>

Extracted text: Input: The first line will consists of one integer T denoting the number of test cases. For each test case: 1) The first line consists of two integers N and K, N being the number of elements in the array and K denotes the number of steps of rotation. 2) The next line consists of N space separated integers, denoting the elements of the array A. Output: Print the required array. Constraints:

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here