Hdu 5920 Ugly Problem

来源:互联网 发布:网络零售的发展特征 编辑:程序博客网 时间:2024/06/07 14:28

Ugly Problem

Special Judge

Problem Description
Everyone hates ugly problems.You are given a positive integer. You must represent that number by sum of palindromic numbers.A palindromic number is a positive integer such that if you write out that integer as a string in decimal without leading zeros, the string is an palindrome. For example, 1 is a palindromic number and 10 is not.

Input
In the first line of input, there is an integer T denoting the number of test cases.For each test case, there is only one line describing the given integer s (1s101000).

Output
For each test case, output “Case #x:” on the first line where x is the number of that test case starting from 1. Then output the number of palindromic numbers you used, n, on one line. n must be no more than 50. Then output n lines, each containing one of your palindromic numbers. Their sum must be exactly s.

Sample Input

2181000000000000

Sample Output
Case #1:299Case #2:29999999999991
Hint
9 + 9 = 18999999999999 + 1 = 1000000000000
这个题就是求不大于x的最大回文数
懒得写,,,,


0 0
原创粉丝点击