Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

$\huge\color{cadetblue}{\text{Pandigital divisibility}}$


In this problem, we say that a number is pandigital if it contains all the digits from $0$ to $9$ exactly once. For example, $1023456789$ is a pandigital number, but $102345678$ and $1023457890$ are not.

The input consists of a positive integer $d \leq 10^7$. The output of your pogram should be all the pandigital numbers that are divisible by $d$. The pandigital numbers should be printed in ascending order, each on a new line. Numbers with a leading $0$ should be omitted. You are not allowed to use a sorting algorithm.


$\Large\color{darkseagreen}{\text{Example}}$

Input:

7777170

Output:

1749863250 
1827634950  
2916438750  
3281965740  
4728519360  
5918426370  
8749316250