Jiggly Puff solution codechef

Jiggly Puff solution codechef

Jigglypuff is a pokemon that loves to sing. But listening to her song induced sleep. To prevent her from singing, Misty gives her an array of nn integer and multiplies each element with its index and ended up sorting this new array. Now she gave Jigglypuff new array and challenged her to find any array which if followed the steps would lead to the given array.

Help poor JigglyPuff solve this problem and save time to show her real talent.

Note: If there are multiple possible arrays, print any and test cases are such that at least one solution always exists.

Input:Jiggly Puff solution codechef

  • First line will contain TT, number of testcases. Then the testcases follow.
  • First line of each testcase contains of a single integer NN, length of array.
  • Next line contains a sorted array of length NNA1,A2,....ANA1,A2,….AN

Output: Jiggly Puff solution codechef

For each testcase, output in a single line answer containing NN integers

Constraints Jiggly Puff solution codechef

  • 1T10001≤T≤1000
  • 1N10001≤N≤1000
  • 1Ai1051≤Ai≤105
  • Sum of NN overall test cases does not exceed 31053∗105

Sample Input: Jiggly Puff solution codechef

1 4 9 16
2 3 6

Sample Output: Jiggly Puff solution codechef

1 2 3 4
3 1 2


Here, if we multiply elements of output array and sort, we will get the input array. For second test case 22 33 11 is also a valid answer.


Click here

Jiggly Puff solution codechef The Maths Lock solution codechef Minimum Adjacent Swaps to Reach the Kth Smallest Number Minimum Interval to Include Each Query

Codechef is an platform built to programmers compete against others in the community and to improve their knowledge by facing various challenges. Challenges are categorised on the basis of their difficulty level , if your rating is above 2000 you are in top tier i.e, Division 3 and if your rating is between 2000 and 1600 you will be in tier 2 i.e, Division 3 and if your rating is below that you will be in lowest tier i.e, Division 3. You can improve your rating by successful submission with minimum penalty.




Also Read : Neenade Naa song lyrics with English Translation

Leave a Comment