Pythagoras' theorem P60825


Statement
 

pdf   zip

thehtml

As Beremiz reminded a sheikh, this is the famous Pythagoras’ theorem:

“In any right triangle, the square of the hypotenuse equals the sum of the squares of the legs.”

Input

Input consists of several cases, each with three natural numbers between 1 and 104.

Output

Print a line for every case. If the three given numbers can be the sides of a right triangle, print its area (it will always be integer). Otherwise, if they can be the sides of a non-degenerate triangle (i.e., with strictly positive area), print “yes”. Otherwise, print “no”.

Public test cases
  • Input

    3 4 5
    10 17 10
    100 1 2
    5 6 11
    

    Output

    6
    yes
    no
    no
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Salvador Roura
    Original language
    Spanish
    Other languages
    Spanish
    Official solutions
    C++
    User solutions
    C++