All submissions for this problem are available.
Ram is the new head-coach in a the local sports training facility.He has to manage the 26
athletic clubs. The name of each club is denoted by a single alphabet.
Each club is ranked according to their name.
As the athletics day is near,he has to choose a sequence for the parade formed by the clubs.
To do so he take a random number M he has generated from
How many different formations can he choose from the given random number, such that its
characters actually denotes the ranks of the clubs and the whole number is used ?.
First line contains T the number of test cases.
The following T lines each contain a random number M.
For each test case, output a single line containing the integral output of the problem
- 1 ≤ T ≤ 10^4
- 1 ≤ M ≤ 10^10
Input: 3 291 111 257 Output: 1 3 2
For the number 291 the answer will be "BIA" i.e the only 1 way. For the number 111 the answer
will be "AAA ","KA","AK",i.e there are 3 ways and so on
|Time Limit:||1 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, CLOJ, FS|
Fetching successful submissions