1160 Forever
Statement
Metadata
- 作者: 陈越
- 单位: 浙江大学
- 代码长度限制: 16 KB
- 时间限制: 3000 ms
- 内存限制: 64 MB
"Forever number" is a positive integer
- the sum of all the digits of
is ; - the sum of all the digits of
is ; and - the greatest common divisor of
and is a prime number which is greater than 2.
Now you are supposed to find these forever numbers.
Input Specification
Each input file contains one test case. For each test case, the first line contains a positive integer
Output Specification
For each pair of Case X
, where X
is the case index (starts from 1). Then print No Solution
.
Sample Input
Sample Output
Case 1
10 189999
10 279999
10 369999
10 459999
10 549999
10 639999
10 729999
10 819999
10 909999
Case 2
No Solution