Decreasing StringsProblem code: TECH09 |
You need to find a string which has exactly K positions in it such that the character at that position comes alphabetically later than the character immediately after it. If there are many such strings, print the one which has the shortest length. If there is still a tie, print the string which comes the lexicographically earliest (would occur earlier in a dictionary).
Input
The first line contains the number of test cases T. Each test case contains an integer K (<= 100)
Output
Output T lines, one for each test case, containing the required string.
Example
Input: 2 1 2 Output: ba cba
| Author: | technovanza10 |
| Date Added: | 17-01-2010 |
| Time Limit: | 2 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, C99 strict, CLOJ, CPP 4.0.0-8, CPP 4.3.2, F#, GO, JAVA, PERL6, PYTH 3.1.2, TEXT |
Comments

Fetching successful submissions

is each character a lowercase
is each character a lowercase one ?