Triangle Formation

4.1

11 votes
Very-Easy
Problem

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
1t104
1018a,b,c,x1018

Time Limit: 1
Memory Limit: 256
Source Limit:
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.

Editor Image

?