АВТ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

482. Multiple with equal digits

Time Limit: 1 seconds
Memory Limit:1000KB
Points:10
View Problem Statistics Submit Problem added Undefined

Задано натуральное число K.

Требуется написать программу, которая вычислит наименьшее число с одинаковыми десятичными цифрами, кратное числу K.

Input

Одно натуральное число K (1 <= K <= 32767).

Output

Выведите два числа - цифру и количество цифр в найденном числе. Если решения не существует, вывести 0 0.

Samples

InputOutput
371 3
100 0

View Problem Statistics Submit Author/source:
Sorted Problems / Mathematics / Theory of numbers /
469. Linear combination 482. 888. Numbers 468. Power 881. Prime numbers on interval
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 0.032 sec.
© Copyright VSTU, AVT, Nosov D.A.