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

문제

N과 K가 주어졌을 때, N보다 크면서 5가 적어도 K번 포함되는 가장 작은 수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 두 자연수 N과 K가 주어진다. (1 ≤ N ≤ 1015, 1 ≤ K ≤ 15)

출력

첫째 줄에 문제의 정답을 출력한다.

예제 입력 1

99 1

예제 출력 1

105

예제 입력 2

595 2

예제 출력 2

655

예제 입력 3

123456789012345 3

예제 출력 3

123456789012355
W3sicHJvYmxlbV9pZCI6IjMxNjUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiI1IiwiZGVzY3JpcHRpb24iOiI8cD5OXHVhY2ZjIEtcdWFjMDAgXHVjOGZjXHVjNWI0XHVjODRjXHVjNzQ0IFx1YjU0YywgTlx1YmNmNFx1YjJlNCBcdWQwNmNcdWJhNzRcdWMxMWMgNVx1YWMwMCBcdWM4MDFcdWM1YjRcdWIzYzQgS1x1YmM4OCBcdWQzZWNcdWQ1NjhcdWI0MThcdWIyOTQgXHVhYzAwXHVjN2E1IFx1Yzc5MVx1Yzc0MCBcdWMyMThcdWI5N2MgXHVhZDZjXHVkNTU4XHViMjk0IFx1ZDUwNFx1Yjg1Y1x1YWRmOFx1YjdhOFx1Yzc0NCBcdWM3OTFcdWMxMzFcdWQ1NThcdWMyZGNcdWM2MjQuPFwvcD5cclxuIiwiaW5wdXQiOiI8cD5cdWNjYWJcdWM5ZjggXHVjOTA0XHVjNWQwIFx1YjQ1MCBcdWM3OTBcdWM1ZjBcdWMyMTggTlx1YWNmYyBLXHVhYzAwIFx1YzhmY1x1YzViNFx1YzljNFx1YjJlNC4gKDEgJmxlOyBOICZsZTsgMTA8c3VwPjE1PFwvc3VwPiwgMSAmbGU7IEsgJmxlOyAxNSk8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5cdWNjYWJcdWM5ZjggXHVjOTA0XHVjNWQwIFx1YmIzOFx1YzgxY1x1Yzc1OC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