HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN254 PRE1B > problem:


2. 51085 - xyx Divisible by k

CEN254 PRE1B

Start: Apr.04.2017 at 01:18:00 PM
Finish: Apr.04.2017 at 02:25:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 1. 51084 - Reflect a matrix
• 2. 51085 - xyx Divisible by k

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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