CEN254 PRE1B |
Старт: 04.апр.2017 в 13:18:00
Финиш: 04.апр.2017 в 14:25:00
Турнир завершён!
• Турнирная таблица
|
|
Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
xyx Divisible by k
Question:
There's a number which contains only two given digits:
x and y. Check if there's any at most 9-digit number
which is divisible by k. For example, if you're given
the digits 2 and 5; and the divisor 15, 225 is the smallest
number divisible by 15. For example if you're given: the
digits 3 and 6; and the divisor 12, 36 is the smallest
number divisible by 12.
Input specification:
You will be given two digits and a number (k).
The digits are different than 0; and k is
between 1 and 9999.
Output specification:
Show the smallest number divisible by k.
If there is no such number, show -1;
Sample Input |
Sample Output |
2 3 6
|
222
|
Explanation:
The following are not divisible by 6:
2; 3; 22; 23; 32; 33; So, 222
is the smallest number divisible by 6.
Для отправки решений необходимо выполнить вход.
|