SMALBOYS - Small Boys and The Prinicpal
There were small school boys who were bunking their classes. The principal caught all those boys and now, they have to arrange themselves according to their heights as the principal was strict. (To align themselves according to their heights in increasing order was something which was taught)
But, all the boys know the number of boys who are smaller than him. Can you give the principal the order of their positions? :)
Input
First Line contains an integer 'T', the number of test cases. The first line of each test case indicates the number of boys 'X'.
In the next line there are 'X' spaced integers. The i'th integer signifies the number of boys which have height less than i.
Constraints
1 <= t <= 1000
0 <= X <= 1000
Output
For every test case, output the formation of the boys in a separate line [ the i'th integer is the rank of the boy(in terms of height) that comes i'th in the height formation ]
Example
Input: 4 6
0 1 2 3 4 5
5
0 0 0 0 0
5
0 1 1 1 4
4
0 0 1 3
Output: 1 2 3 4 5 6
5 4 3 2 1
1 4 3 2 5
2 3 1 4
hide comments
Jacob Plachta:
2014-04-22 11:36:59
This problem is basically a clone of http://www.spoj.com/problems/IITWPC4D/, except that this one is much less clear (in fact, it's completely missing key information).
|
|
Flago:
2014-04-22 11:00:27
Any tricky case ? |
|
Tanmay:
2014-04-21 23:30:51
Just a small trick in the end. Test-cases are great :) |
|
Kaushik:
2014-04-21 23:30:51
I'll update the problem. The time-limit was less so I thought people should have guessed it. |
|
Apoorv Gupta:
2014-04-21 23:30:51
constraints ? |
Added by: | Kaushik |
Date: | 2014-04-21 |
Time limit: | 0.300s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | Foobar |