A positive integer is called a "PDS Number" if the product of its digits is divisible by the sum of its digits. Let PDS(N) be the N-th PDS Number (indexed from 1), you are requested to calculate it.
There are several test cases (at most 10000), each formed as follows:
- The first and only line contains a positive integer N (N ≤ 109).
The input is ended by N = 0.
For each test case, output on a line the respective PDS(N) calculated.
Input: 1 20 0 Output: 1 66
|Tags||anhdq, april12, medium|
|Time Limit:||2.26437 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, 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