Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Diophantus of Alexandria
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 y = ^{n}z. Fermat suggested that for ^{n}n > 2, there are no solutions with positive integral values for x, y and z. A proof of this theorem (called Fermat’s last theorem) was found only recently by Andrew Wiles.Consider the following Diophantine equation: (1) Diophantus is interested in the following question: for a given n, how many distinct solutions (i. e., solutions satisfying Clearly, enumerating these solutions can become tedious for bigger values of 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 “ Sample Input 2 4 1260 Sample Output Scenario #1: 3 Scenario #2: 113 Source TUD Programming Contest 2006, Darmstadt, Germany |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator