A string is made of only lowercase latin letters (a,b,c,d,.....,z). Can you find the length of the lexicographically smallest string such that it has exactly K sub-strings, each of which are palindromes?
The first line of input contains single integer T - the number of testcases.
T lines follow, each containing the integer K.
Output exactly T lines. Each line should contain single integer - the length of the lexicographically smallest string.
2 10 17
4 7
Migrated from old NTUJ.
hacker rank
No. | Testdata Range | Score |
---|