ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Linear Data Structures: Arrays > задача:


51085 - xyx Divisible by k

Гость
• Вопросы к жюри (2)

Задачи раздела

• 51098 - Rotate a matrix
• 51061 - The Longest Path
• 51083 - Grades Histogram
• 51084 - Reflect a matrix
• 51011 - Decoding the Path
• 51088 - Number of letters
• 51172 - The biggest Minute
• 51125 - Filling an Array 3
• 51085 - xyx Divisible by k
• 51087 - Are they the same?
• 51091 - Guess the number - 1
• 51015 - Student Scholarships
• 51008 - Sum of Regional Maxes
• 51020 - Number of nodes removed
• 51141 - Most valuable stock items
• 51014 - Nine Men's Morris game
• 51019 - Finding the hidden message

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 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.



Для отправки решений необходимо выполнить вход.

www.contester.ru