시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB43375.000%

문제

Given $k$ and $n$, find the $n$-th positive integer $x$ such that the decimal representation of $x\cdot\underbrace{999\ldots9}_k$ doesn't contain any $9$.

입력

The only line contains two integers $k$ and $n$ ($1\le k\le 18$, $1\le n\le 10^{18}$).

출력

Print the answer.

예제 입력 1

1 1

예제 출력 1

2

예제 입력 2

1 8

예제 출력 2

9

예제 입력 3

1 9

예제 출력 3

12

예제 입력 4

1 10

예제 출력 4

13

예제 입력 5

5 1

예제 출력 5

11112

예제 입력 6

5 84

예제 출력 6

11235

예제 입력 7

5 668

예제 출력 7

12345

예제 입력 8

5 733942

예제 출력 8

2281488

힌트

For $k = 1$, the sequence of all valid numbers starts with $2, 3, 4, 5, 6, 7, 8, 9, 12, 13, \ldots$