All submissions for this problem are available.
Bruce Wayne retires as Batman and now own an apple orchard and so does Mr.Fox. Now as Mr.Fox is creative and cannot sit idle he decides to play tricks on Bruce. He gives Bruce a number N and tells him to represent the number using his any 32 apples. Bruce has two color apples in his orchard red and green..
Now , Bruce being Batman does this task easily , so Mr. Fox asks him to find length of longest sequence in that representation of number N , such that the sequence is a palindrome.Your job is to help Bruce do the task ;)
First line contains T test cases , followed T lines each containing a number N.
Output the each test case in a new line.
- 1 ≤ T ≤ 100000
- 1 ≤ N ≤ 1000000000
Input: 2 10 100 Output: 28 25
|Time Limit:||0.3 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.5, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.