|
||||||||||
TriangleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 868 Accepted Submission(s): 490 Problem Description K likes to play with the balls.That day he piled a triangle (n layers, layer 1 start,the first layer has 1 ball,the secode layer has 2 balls,¡¡,the nth layer has n balls), but he felt uncomfortable after completion, and want to pile a right triangle, because he felt that the number 4 is a lucky one (because of ¡°si ji fa cai¡±). So he decided to use 4 times of the balls he just used as a right-edge side of the right triangle(the three edges have no common factor).He only to pile the three edges,that is the middle is empty.But there will not have so many balls,so he wants to know the minimum of balls he must use.Now ,he turn to you for help. Input The layer of the triangle as the promble describes n,1 <= n < 2^16 Output The minimum of balls he must use and the length of the hypotenuse. One case one line Sample Input
Sample Output
Author Klion@CSU Source | ||||||||||
|