Rope Cutting
Submissions: 1596   Accuracy:

50.29%

  Difficulty: Easy   Marks: 2

You are given N ropes. A cut operation is performed on ropes such that all of them are reduced by the length of the smallest rope. Display the number of ropes left after every cut operation till the length of each rope is zero.

Input: The first line of input contains integer T denoting the number of test cases. For each test case, there is a line containing the integer N(no of ropes) followed by the N space separated elements(length of rope).


Output: For each test case, print the number of ropes that are left after each operation with space. IF no ropes left after one operation, in this case, we print 0.
 

Constraints:

1<=T<=100

1<=N<=100
Example:

Input: 
2
6
5 1 1 2 3 5
10
5 1 6 9 8 11 2 2 6 5
Output: 
4 3 2
9 7 5 3 2 1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Vanshika
Author: Vanshika_pec


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.