Given three natural numbers , and , let us say that a natural number is crazy if is a multiple of , and represented in base
has exactly digits (maybe with a leading zero),
and does not have two equal consecutive digits.
Given , and , can you find all crazy numbers?
Input consists of several cases, each one with , and . You can assume , , and .
For every case, print in order and with exactly digits all crazy numbers in base , followed by a line with ten dashes. All given cases are such that there are between 1 and 100 crazy numbers.
The expected solution requires less than 0.1 seconds to solve Sample input 2.
Author: Salvador Roura
Generation: 2026-01-25T10:35:02.904Z
© Jutge.org, 2006–2026.
https://jutge.org