India to Mars
All submissions for this problem are available.Recently India is achieving great heights in space science. India has intelligent minds like "Melon Rusk" who owns companies like SpecsX. Spaceship of SpecsX returned to earth with some precious Mars coins from mars trip. Each Mars coin has an integer number written on it denoting value of coin. A coin with number $N$ can be exchanged in a SpecsX bank into three coins of values: $N/2$, $N/3$ and $N/4$. But these numbers are all rounded down (the banks have to make a profit). You can also sell Mars coins for candies. The exchange rate is $1:1$. But you cannot buy Mars coins. You have one Mars coin. What is the maximum amount of candies you can get for it? ###Input The first line of input contains an integer $T$ denoting the number of test cases. For each test case first line contains integer $N$. ###Output For each test case output a single line, containing the maximum amount of candies you can get. ###Constraints: - $1 <= T <= 100$ - $0 <= N <= 10^9$ ###Example Input: 2 12 2 Output: 13 2 ###Explaination: You can change 12 into 6, 4 and 3, and then change these into 6+6+4+3=3=13. If you try changing the coin 2 into 3 smaller coins, you will get 1, 0 and 0, and later you can get no more than 11 out of them. It is better just to change the 22 coin directly into 22.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.