Triangle Formation
71% Success2476 Attempts10 Points1s Time Limit256MB Memory1024 KB Max Code

You are given a triplet of 3 integers a , b , c and a number x. Now you need to check if it is possible to make a right angled triangle by adding the value x to any two of the numbers in the given triplet. You have to print YES if it is possible or else print NO.

**It is necessary to add the number x**.
Input
First line contains a number t as input denoting total number of test cases. Each test case contains four space separated integers \(a , b , c , x\) .
Output
In the output you have to print YES or NO according to the condition discussed above.
Constraints
\(1 \le t \le 10^4\)
\(-10^{18} \le a , b ,c , x \le 10^{18} \)

Examples
Input
1
3 4 5 0
Output
YES
Explanation

In the sample if you add 0 to any of the two sides you see that the triangle formed will be a right angled triangle.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading Editor...
Results