시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 217 52 48 33.103%

문제

혁화는 초등학생 동생의 곱셈 숙제를 도와주다가 새롭게 알아낸 사실이 있다.

102564에 4를 곱하면 410256이 되고, 이 수는 102564가 오른쪽으로 한 칸씩 옮겨진 숫자이다.

이렇게 어떤 숫자에 n을 곱했는데 오른쪽으로 한 칸씩 옮겨지는 숫자를 n-극적인 숫자라고 한다. 예를 들어, 102564와 128205는 4-극적인 숫자이다.

두 숫자 n과 k가 주어졌을 때, n-극적인 숫자중 마지막 숫자가 k인 수를 구하는 프로그램을 작성하시오. (정답이 여러 가지인 경우 가장 작은 것을 출력한다)

입력

첫째 줄에 n(1 ≤ n ≤ 9)과 k(1 ≤ k ≤ 9)가 공백을 사이에 두고 주어진다.

출력

첫째 줄에 구한 n-극적인 숫자 중 마지막 숫자가 k인 수를 출력한다. 그런 숫자가 존재하지 않는 경우에는 0을 출력한다.

예제 입력 1

4 5

예제 출력 1

128205
W3sicHJvYmxlbV9pZCI6IjE5NzkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFkZjlcdWM4MDFcdWM3NzggXHVhY2YxXHVjMTQ4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWQ2MDFcdWQ2NTRcdWIyOTQgXHVjZDA4XHViNGYxXHVkNTU5XHVjMGRkIFx1YjNkOVx1YzBkZFx1Yzc1OCBcdWFjZjFcdWMxNDggXHVjMjE5XHVjODFjXHViOTdjIFx1YjNjNFx1YzY0MFx1YzhmY1x1YjJlNFx1YWMwMCBcdWMwYzhcdWI4NmRcdWFjOGMgXHVjNTRjXHVjNTQ0XHViMGI4IFx1YzBhY1x1YzJlNFx1Yzc3NCBcdWM3ODhcdWIyZTQuPFwvcD5cclxuXHJcbjxwPjEwMjU2NFx1YzVkMCA0XHViOTdjIFx1YWNmMVx1ZDU1OFx1YmE3NCA0MTAyNTZcdWM3NzQgXHViNDE4XHVhY2UwLCBcdWM3NzQgXHVj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