시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 101 27 25 33.333%

문제

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

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