This page is still under construction.

Parts of this page are still being built. What you see may change.

Right Triangle

Time limit1sMemory limit128 MB

Summary
Given three side lengths per test case in any order, decide whether they form a right triangle.
Level

Easy1 of 10

Topics
Math, Sorting
Solved
No attempts yet

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

c2=a2+b2c^2 = a^2 + b^2

where cc 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 TT, the number of test cases (T≤100000T \le 100000). Each of the next TT lines holds one test case.

A test case is three integers aa, bb and cc, 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 xx is the case number starting from 1 and MM is YES when the given triangle is a right triangle and NO otherwise. Do not print the quotation marks.

Examples1

  1. Example 1

    Input
    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
    
    Expected output
    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