题目描述

A right triangle can have sides that are all integers. A set of three integer values for the sides of a right triangle is called a Pythagorean triple. These three sides must satisfy the relationship that the sum of the squares of two of the sides is equal to the square of the hypotenuse. Find all Pythagorean triples for side1, side2 and hypotenuse all no larger than 500. Use a triple-nested for loop that tries all possibilities. This is an example of brute force computing. You’ll learn in more advanced computer science courses that there are many interesting problems for which there’s no known algorithmic approach other than sheer brute force.


输入格式

No need for input. You are required to find and print all Pythagorean triples for side1, side2 and hypotenuse all no larger than 500.


输出格式

Note that 3 4 5 and 4 3 5 are the same. You only need to print 3 4 5. (side1<=side2)


样例数据

输入


                            

输出

3 4 5
5 12 13
6 8 10
7 24 25
8 15 17
9 12 15
9 40 41
10 24 26
11 60 61
12 16 20
12 35 37
13 84 85
(Note that only 12 items are shown here. You need to print all Pythagorean triples for side1, side2 and hypotenuse all no larger than 500. )

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解