Submit  All submissions  Best solutions  Back to list 
FACTORAD  Factoradic 
Wersja polska  English version 
For given number n your task is to print factoradic of n in decimal representation.
Input
The first line of the standard input contains one integer t (t<10001) which is the number of test cases.
In each of the next t lines there is one number n (n<1000000001).
Output
For each test, print factoradic of n in decimal representation.
Example
Input:
6
4600
10000
52608434
395033
1
1000000000
Output:
6212200
16512200
134861130100
1062342210
10
2105644512200
Added by:  Piotr Kąkol 
Date:  20100110 
Time limit:  2.857s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: SCM qobi 
hide comments
20110501 20:25:06 Piotr KÄ…kol
No. Your last submission got WA because You print 2028256440200 for 888440980 and the answer is 11028256440200. Last edit: 20110501 20:27:43 

20110430 16:47:18 Hallvard Norheim Bø
Is n=0 a possible testcase? 

20100812 13:12:07 Piotr KÄ…kol
For 888440980 the correct answer is 11028256440200. 

20100812 11:22:24 Piotr Fusik
Could you please check why I get WA? Thank you. 

20100223 12:44:39 Piotr KÄ…kol
There aren't leading zeros. You ought to print factoradic in decimal representation. Sorry for understatement. For 439084800 You should print 1100000000000. Last edit: 20100223 12:47:46 

20100222 22:51:18 Paulo Roberto Santos de Sousa
I am getting several WA. Is there leading zeros for some case? the output for 439084800 is B00000000000? Last edit: 20100222 22:53:07 