Numbers, Numbers, NumbersProblem code: MANIP2 |
Okay. Before we begin, a hint : This one's taken from somewhere. Word to word. Google comes to mind, doesn't it? Here goes: For the heck of it, we define a new sequence as the infinite sequence of all integers, in ascending order, that can represented as any positive integer power of 5 (i.e 5k where k is a positive integer) or as a sum of distinct positive integer powers of 5 (i.e 5a1 + 5a2 + 5a3 + ... , where a1, a2, a3, ... are distinct positive integers). All the numbers in the lucky sequence are called lucky numbers. The first few numbers are 5, 25, 30, 125, 130, 150, ... Given n your task is to find the nth number in the sequence.
Input
First line of input contains an integer t, t <= 200, representing the number of test- cases. Then t lines follow each containing one integer n, 1 <= n <= 8000.
Output
For each test case output the "Case#x" followed by nth number on a separate line. Answers will fit in a 32-bit signed integer.
Sample
Input 4 1 2 3 9 Output 5 25 30 630
| Author: | admin |
| Date Added: | 31-08-2009 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments

Fetching successful submissions

is the output 630 of input 9
is the output 630 of input 9 correct??
yes.
yes.
hi Event though no one's
hi
Event though no one's asked(and people have solved the question correctly), the output does not contain "Case #X:"
regards,
Ankur
How to make submissions?
How to make submissions?