| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 15 | 4 | 4 | 33.333% |
Ugnė and Jūratė enjoy collecting mascots with various numbers on them. Jūratė only collects mascots with numbers composed of the same same digits. Ugnė, however, collects mascots with numbers coposed of ones.
One day, while studying division, the girls noticed that if they divide some Ugnė’s numbers by Jūratė’s numbers, it is possible to obtain numbers of an interesting shape. For example, 111 111 111/9 = 12 345 679.
Girls wondered: What other sequences of numbers can be produced and what are the sums of their digits? Unfortunately, the numbers may be very big and it is too complicated for the girls to perform the division themselves. Therefore, they are asking you for help.
You are given the numbers of Ugnė and Jūratė. Divide the Ugnė’s number by the Jūratė’s number, calculate the result of division and find the sum of digits of the division result.
On the first line, there is given one integer N: the amount of digits in the Ugnė’s number. On the second line, there are given integers M and d. They indicate that Jūratė’s number is made from the digit d, repeated M times.
Output the only number – the sum of the digits of the division result. If the division result is not an integer, output NESIDALO (Lithuanian for not divisible).
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 24 | N, M ≤ 9 |
| 2 | 30 | N ≤ 1 000 000, M ≤ 9 |
| 3 | 27 | N, M ≤ 1 000 000 |
| 4 | 10 | d = 1, 3 or 9 |
| 5 | 9 |
9 1 9
37
The example given in the problem description.
6 2 4
NESIDALO
When dividing 111 111 by 44 we get 2525,25 which is not an integer.
Olympiad > Lithuanian Olympiad in Informatics > Lithuanian Olympiad in Informatics 2016/2017 > National Round (2) > 7-9 Classes ?번
Olympiad > Lithuanian Olympiad in Informatics > Lithuanian Olympiad in Informatics 2016/2017 > National Round (2) > 10-12 Classes ?번