Right Triangle
Time limit1sMemory limit128 MB
Given three side lengths per test case in any order, decide whether they form a right triangle.
Problem
A right triangle is a triangle with one right angle, that is, one angle of 90 degrees. Its longest side is the hypotenuse, and the three side lengths satisfy
where is the hypotenuse.
Given the three side lengths of a triangle, decide whether the triangle is a right triangle.
Input
The first line has a positive integer , the number of test cases (). Each of the next lines holds one test case.
A test case is three integers , and , the side lengths of a triangle. Every side length is between 1 and 100, inclusive, and the three values can come in any order.
Output
For each test case, print one line in the format Case #x: M, where is the case number starting from 1 and is YES when the given triangle is a right triangle and NO otherwise. Do not print the quotation marks.