|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|5 초||256 MB||10||9||8||88.889%|
A Hill Number is a number whose digits possibly rise and then possibly fall, but never fall and then rise.
Given an integer n, if it is a hill number, print the number of hill numbers less than it. If it is not a hill number, print -1
Input will start with a single line giving the number of test cases. Each test case will be a single positive integer on a single line, with up to 70 digits. The result will always fit into a 64-bit long.
For each test case, print -1 if the input is not a hill number. Print the number of hill numbers less than the input value if the input value is a hill number.
5 10 55 101 1000 1234321
10 55 -1 715 94708