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

10646번 - ZGODAN 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 32 MB60312752.941%

문제

An integer is considered handsome if every two of its consecutive digits are of different parity. For a given integer N, what is its closest handsome number?

Please note: Numbers consisting of only one digit are handsome numbers. The distance of two numbers is the absolute value of their difference.

입력

The first and only line of input contains the positive integer N that consists of at most thousand digits and is not handsome.

출력

The first and only line of output must contain the required closest handsome number. If two closest numbers exist, output the smaller number first and then the larger one and separate them by a single space.

제한

예제 입력 1

13

예제 출력 1

12 14

예제 입력 2

5801001

예제 출력 2

5810101

힌트

출처

Contest > Croatian Open Competition in Informatics > COCI 2014/2015 > Contest #5 4번

  • 데이터를 추가한 사람: shjgkwo
(追記) (追記ここまで)

출처

대학교 대회

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

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