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

7111번 - The Strange Sequence 다국어

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

문제

There is a sequence of positive integers {ai}. For each i (i>1) ai is the least possible integer with the following features:

  1. ai > ai-1,
  2. the sum of ai digits equals the sum of 4 * ai-1 digits.

For the given values of the first sequence member a1 and the index n, you must find and output the value of the an.

입력

The values of integers a1 (0 < a1 < 20) and n (0 < n < 10000) are input from the keyboard.

출력

You must write one integer on the screen - the value of the an. For the testing, only data where the corresponding an value does not increase 109 are to be used.

제한

예제 입력 1

4 5

예제 출력 1

79

힌트

출처

Olympiad > Latvian olympiad in informatics > 10th Latvian olympiad in informatics > Stage III (Country) 3번

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

출처

대학교 대회

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

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