시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 48 | 19 | 16 | 42.105% |
Using a pocket calculator, enter a positive integer K and press "+". The calculator still shows the number K. Then again enter the number K. After pressing the "+" key for the second time, the result is: K + K. The game goal is to obtain a number, consisting of equal digits only, by repeating this operation many (possibly 0) times. Write a program calcgame that determines whether it is possible to reach the goal.
If possible, what is the first number, which consists of equal digits only and is obtained by multiple summing?
On the standard input, a positive integer K is given. (1 ≤ K ≤ 999)
If reaching the goal is impossible, print "Impossible". If possible, a line of the standard output should contain two integers separated by a space: the first is the digit itself and the second is the amount of digits of the obtained number.
37
1 3
25
Impossible
999
9 3
Olympiad > International Autumn Tournament in Informatics > 2011 > Group B (Juniors) 2번