АВТ
Language: Russian
English

Remote Training on Programming

Problems Online status Contests
News FAQ E-learning
For authors:
Register  ||  Login
 
Hello, Guest! Please login or register.

482. Multiple with equal digits

Time Limit: 1 seconds
Memory Limit:65536KB
Points:100
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 Problem discussion Author/source:
Sorted Problems / Mathematics / Theory of numbers /
1628. Lucky Ticket 482. 888. Numbers 467. Pipeline 468. Power
Problems from Contests and Camps / School olympiads and couses of Vologda region / Impulse - 2019 / Number Theory /
1630. 05 - Fractional Arithmetics 482. 1351. 07 - Prime Numbers 1736. 08 - Sum of Digits 1739. 09 - Euler Function
Problems from Contests and Camps / School olympiads and couses of Vologda region / Impulse, september 2020 / Impulse-2020, number theory /
1630. 05 - Fractional Arithmetics 482. 1736. 07 - Sum of Digits 1739. 08 - Euler Function 1808. 09 - Quadratic Equation
time generating 0.609 sec.
© Copyright VSU, AVT, Nosov D.A., Andrianov I.A.