eolymp
bolt
Try our new interface for solving problems
Problems

Diophantus of Alexandria

Diophantus of Alexandria

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 \textit{diophantine equations}. One of the most famous diophantine equation is \textbf{x^n + y^n = z^n}. Fermat suggested that for \textbf{n} > \textbf{2}, there are no solutions with positive integral values for \textbf{x}, \textbf{y} and \textbf{z}. A proof of this theorem (called Fermat's last theorem) was found only recently by Andrew Wiles. Consider the following diophantine equation: \textbf{1/x + 1/y = 1/n} where \textbf{x}, \textbf{y}, \textbf{n} \textbf{∈} \textbf{N^\{+\}} (1) Diophantus is interested in the following question: for a given \textbf{n}, how many distinct solutions (i. e., solutions satisfying \textbf{x} ≤ \textbf{y}) does equation (1) have? For example, for \textbf{n = 4}, there are exactly three distinct solutions: \textbf{1 / 5 + 1 / 20 = 1 / 41 / 6 + 1 / 12 = 1 / 41 / 8 + 1 / 8 = 1 / 4} Clearly, enumerating these solutions can become tedious for bigger values of \textbf{n}. Can you help Diophantus compute the number of distinct solutions for big values of \textbf{n} quickly? \InputFile The first line contains the number of scenarios. Each scenario consists of one line containing a single number \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{10^9}). \OutputFile The output for every scenario begins with a line containing "\textbf{Scenario #i:}", where \textbf{i} is the number of the scenario starting at \textbf{1}. Next, print a single line with the number of distinct solutions of equation (1) for the given value of \textbf{n}. Terminate each scenario with a blank line.
Time limit 1 second
Memory limit 128 MiB
Input example #1
2
4
1260
Output example #1
Scenario #1:
3

Scenario #2:
113