#Lutece0598. 吉利数字
吉利数字
Migrated from Lutece 598 吉利数字
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
中国人喜欢数字和。特别地,一些人喜欢满足含有特定个数和的数。
现在请求出,在区间之间的第大的含有个和个的数。
Input
输入由不超过组输入数据组成。
每组数据由给出的一行开始。,不超过,且。
接下来的一行给出该组数据的询问数(不超过)。
接下来行中,每行有一个整数。
Output
对于每组数据,先输出Case #T:
,其中是数据的编号(从开始)。
然后对于某个询问,输出对应的第大的数。如果不存在则输出That's too bad!
。
Samples
1
1 1000 1 1
10
1
2
3
4
5
6
7
8
9
100
Case #1:
68
86
168
186
268
286
368
386
468
That's too bad!
Resources
UESTC Training for Dynamic Programming