#Lutece0638. Krolia的页码问题
Krolia的页码问题
Migrated from Lutece 638 Krolia的页码问题
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Krolia要给自己的一本已经完成的书编上页码。众所周知,书的页码是一个不含多余前导零的数字串,第一页页码是,第二页页码是,第三页页码是,……。而Krolia敲一次键盘就能打出一个数字,例如打出需要敲一次键盘,打出需要敲两次键盘。页码编完之后,Krolia记得自己总共敲了次键盘,问Krolia的书有多少页。
Input
有多组测试数据。输入的第一行是整数(),表示测试数据的组数。每一组测试数据只有一行,只有一个整数(),表示Krolia敲了次键盘。该行没有其它多余的符号。
Output
如果有解,则输出书的页数。如果无解,输出。
Samples
3
4
10
11
4
-1
10
Resources
KroliaFansClub