eolymp
bolt
Try our new interface for solving problems
Problems

Equal numbers

Equal numbers

Given a positive integer \textbf{K}. Find the smallest multiple of \textbf{K}, all digits are equal (using, of course, the decimal system). \InputFile Set the number of \textbf{K} (\textbf{2} <= \textbf{K} <= \textbf{1000}). \OutputFile Display the number and the number of digits in the number. If the solution does not exist, display \textbf{0} \textbf{0}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
9
Output example #1
9 1
Source II этап Всеукраинской олимпиады школьников 2008-2009, г. Бердичев