#Lutece1497. Difference
Difference
Migrated from Lutece 1497 D
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
Little Ruins is playing a number game, first he chooses two positive integers and and calculates , here
$$f(y, K) = \sum_{z\text{ in every digits of }y} z^K $$e.g.
then he gets the result
As Ruins is forgetful, a few seconds later, he only remembers , and forgets . please help him find how many satisfy .
Input
First line contains an integer (), which indicates the number of test cases.
Every test case contains one line with two integers , ().
Output
For every test case, you should output Case #x: y
, where x
indicates the case number and counts from and y
is the result.
Samples
2
2 2
3 2
Case #1: 1
Case #2: 2
Resources
第二届中国大学生程序设计竞赛 杭州站(CCPC 2016 Hangzhou Site)