Champernowne Verification
면접 대비시간 제한1초메모리 제한2048 MB
앞에 0이 없는 1 이상 10^9 이하의 정수 n이 1부터 k까지 이어 붙인 수인지 판별하고, 맞으면 k를, 아니면 -1을 출력한다.
문제
The Champernowne word is obtained by writing down the first positive integers and concatenating them together. For example, the Champernowne word is .
Given a positive integer , determine if it is a Champernowne word, and if so, which word.
입력
The first line contains a single integer, (). will not have leading zeroes.
출력
If is the Champernowne word, output . Otherwise, output .