Logo
(追記) (追記ここまで)

3387번 - Calculator Game 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB158584037.037%

문제

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.

제한

예제 입력 1

37

예제 출력 1

1 3

예제 입력 2

25

예제 출력 2

Impossible

예제 입력 3

999

예제 출력 3

9 3

힌트

출처

Olympiad > International Autumn Tournament in Informatics > 2011 > Group B (Juniors) 2번

  • 문제의 오타를 찾은 사람: shiftpsh
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /