#C3755. Self Dividing Numbers
Self Dividing Numbers
Self Dividing Numbers
A self dividing number is a number that is divisible by every one of its non-zero digits. In other words, for a number \(n\), if each digit \(d_i \neq 0\) satisfies \(n \mod d_i = 0\), then \(n\) is called a self dividing number. For instance, \(128\) is a self dividing number because \(128 \mod 1 = 0\), \(128 \mod 2 = 0\), and \(128 \mod 8 = 0\).
Given two integers \(L\) and \(R\), your task is to find all self dividing numbers in the inclusive interval \([L, R]\). Print these numbers in ascending order, separated by a space.
Note: A self dividing number does not contain the digit zero.
inputFormat
The input consists of a single line containing two space-separated integers \(L\) and \(R\) (with \(1 \le L \le R \le 10^4\)).
outputFormat
Output the self dividing numbers within the range \([L, R]\) in ascending order, separated by a space.
## sample1 22
1 2 3 4 5 6 7 8 9 11 12 15 22