#Lutece0276. Diophantus
Diophantus
Migrated from Lutece 276 Diophantus
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
Diophantus of Alexandria was an Egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations where variables were restricted to integral values. In honor of him, these equations are commonly called Diophantine equations. One of the most famous Diophantine equation is . Fermat suggested that for , there are no solutions with positive integral values for and . A proof of this theorem (called Fermat’s last theorem) was found only recently by Andrew Wiles.
Consider the following Diophantine equation:
Diophantus is interested in the following question: for a given , how many distinct solutions (i. e., solutions satisfying ) does equation have? For example, for , there are exactly three distinct solutions:
Clearly, enumerating these solutions can become tedious for bigger values of . Can you help Diophantus compute the number of distinct solutions for big values of quickly?
Input
The first line contains the number of scenarios. Each scenario consists of one line containing a single number .
Output
The output for every scenario begins with a line containing Scenario #i:
, where is the number of the scenario starting at . Next, print a single line with the number of distinct solutions of equation for the given value of . Terminate each scenario with a blank line.
Samples
2
4
1260
Scenario #1:
3
Scenario #2:
113
Note
The data used in this problem is unofficial data prepared by OrangeWall. So any mistake here does not imply mistake in the offcial judge data.
Resources
TUD Programming Contest 2006, Darmstadt, Germ