printРабочее место участника

printЗадачи

1423. Quodigious

Ограничения: время – 2s/4s, память – 64MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод copy
Послать решение Blockly Посылки Темы Где Обсудить (0)

According to Dr. Rich, a quodigious number is a positive decimal number whose digits are each greater than 1, and which is evenly divisible by both the sum and product of its digits. For example, 735 is a quodigious number since its digits 7, 3 and 5 are each greater than 1, and 735 is evenly divisible (with zero remainder) by `7\ *\ 3\ *\ 5\ =\ 105` and `7\ +\ 3\ +\ 5\ =\ 15`. In this program, we will find and print quodigious numbers.
Input Format
The input consists of one or more positive integers, each representing a number of decimal digits `n\ <\ 10`.
Output Format
For each number `n` in the input, output all `n`-digit quodigious numbers on successive lines, followed by an empty line.

Sample Input

1 2 3 4

Sample Output

2
3
4
5
6
7
8
9

24
36

224
432
624
735

2232
3276
4224
6624

Source: California State Polytechnic University Programming Contest, Spring 2008
loading