[BOJ 9723] Right Triangle
View as PDFA right triangle or right-angled triangle is a triangle in which one angle is a
right angle (that is, at 90 degrees angle). The largest side of such a triangle is called hypotenuse. The relation between the sides of the triangle is</p>
c2=a2+b2, Where c is the hypotenuse
Given 3 sides of a triangle, your task is to determine whether the given triangle is a right triangle or not.
입력 형식
The first line has a positive integer T, T <= 100000, denoting the number of test cases. This is followed by each test case per line. </p>
Each test case consists of a line containing 3 integers a,b and c denoting the sides of a triangle. All of these sides will be between 1 and 100, inclusive. The sides a,b and c can be given in any order.
출력 형식
For each test case, the output contains a line in the format Case #x: M, where x is the case number (starting from 1) and M is “YES” when the given triangle is a right triangle or “NO” otherwise. Note that the quotes are not required to be outputted.
예제 입력
10
20 16 12
5 3 4
15 12 9
12 5 13
12 13 5
28 82 46
43 96 92
3 4 5
13 5 12
6 10 8
예제 출력
Case #1: YES
Case #2: YES
Case #3: YES
Case #4: YES
Case #5: YES
Case #6: NO
Case #7: NO
Case #8: YES
Case #9: YES
Case #10: YES
Comments