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:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.