s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1 value | original_language stringclasses 11 values | filename_ext stringclasses 1 value | status stringclasses 1 value | cpu_time int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807 values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s964396401 | p00003 | u166871988 | 1477923110 | Python | Python3 | py | Accepted | 30 | 7616 | 201 | n=int(input())
for i in range(n):
hens=[int(i) for i in input().split(" ")]
t=max(hens)
hens.remove(t)
if t**2==hens[0]**2+hens[1]**2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,702 |
s134997840 | p00003 | u149199817 | 1477970663 | Python | Python3 | py | Accepted | 50 | 7604 | 411 | # -*- coding: utf-8 -*-
import sys
def is_right_triangle(hypotenuse, x, y):
if x**2 + y**2 == hypotenuse**2:
return True
return False
def main():
N = int(input())
for i in range(N):
length = [int(n) for n in input().split()]
length.sort(reverse=True)
ret = 'YES' if is_right_triangle(*length) else 'NO'
print(ret)
if __name__ == '__main__':
main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,703 |
s035232729 | p00003 | u886845205 | 1478196868 | Python | Python3 | py | Accepted | 40 | 7652 | 158 | for i in range(int(input())):
n = [int(i) for i in input().split(" ")]
n.sort()
print("YES" if n[0] * n[0] + n[1] * n[1] == n[2] * n[2] else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,704 |
s061506002 | p00003 | u175111751 | 1478447381 | Python | Python3 | py | Accepted | 60 | 7668 | 186 | N = int(input())
while N > 0:
es = sorted(list(map(int, input().split())))
if es[2] ** 2 == es[1] ** 2 + es[0] ** 2:
print('YES')
else:
print('NO')
N -= 1 | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,705 |
s909989145 | p00003 | u660912567 | 1478706702 | Python | Python3 | py | Accepted | 60 | 7540 | 157 | for i in range(int(input())):
line = sorted(list(map(int, input().split())),reverse=True)
print('YES' if line[0]**2==line[1]**2+line[2]**2 else 'NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,706 |
s284600099 | p00003 | u922871577 | 1479277978 | Python | Python | py | Accepted | 20 | 6236 | 125 | n = input()
for i in xrange(n):
a, b, c = sorted(map(int, raw_input().split()))
print 'YES' if a*a+b*b==c*c else 'NO' | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,707 |
s017057093 | p00003 | u146816547 | 1479457686 | Python | Python | py | Accepted | 20 | 6268 | 179 | n = int(raw_input())
for i in range(n):
a = map(int, raw_input().split())
a.sort()
if a[0]**2 + a[1]**2 == a[2]**2:
print 'YES'
else:
print 'NO' | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,708 |
s436464215 | p00003 | u779577827 | 1479470842 | Python | Python3 | py | Accepted | 30 | 7864 | 149 | [print("YES" if x[0] + x[1] == x[2] else "NO") for x in [sorted([x * x for x in [int(i) for i in input().split(" ")]]) for _ in range(int(input()))]] | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,709 |
s049833741 | p00003 | u328069918 | 1479470934 | Python | Python3 | py | Accepted | 30 | 7860 | 132 | [print("YES" if y[0] + y[1] == y[2] else "NO") for y in [sorted([int(x)**2 for x in input().split()]) for _ in range(int(input()))]] | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,710 |
s732418638 | p00003 | u542645301 | 1479475526 | Python | Python3 | py | Accepted | 40 | 7596 | 143 | [print(["YES", "NO"][0 if i[0] + i[1] == i[2] else 1]) for _ in range(int(input())) for i in [sorted([int(x) ** 2 for x in input().split()])] ] | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,711 |
s699507614 | p00003 | u542645301 | 1479475606 | Python | Python3 | py | Accepted | 40 | 7624 | 134 | [print("YES" if i[0] + i[1] == i[2] else "NO") for _ in range(int(input())) for i in [sorted([int(x) ** 2 for x in input().split()])]] | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,712 |
s583682496 | p00003 | u542645301 | 1479475708 | Python | Python3 | py | Accepted | 40 | 7588 | 134 | [print("YES" if i[0] + i[1] == i[2] else "NO") for _ in range(int(input())) for i in [sorted([int(x) ** 2 for x in input().split()])]] | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,713 |
s846405512 | p00003 | u292012552 | 1479789729 | Python | Python3 | py | Accepted | 40 | 7488 | 208 | n = int(input())
for _ in range(n):
edges = list(map(int, input().split()))
if len(edges) == 0:
break
edges.sort()
if edges[0] ** 2 + edges[1] ** 2 == edges[2] ** 2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,714 |
s731397105 | p00003 | u546285759 | 1480233207 | Python | Python3 | py | Accepted | 30 | 7592 | 230 | N = int(input())
ans = []
for i in range(N):
d = list(map(int, input().split()))
d.sort()
if d[2]**2 == d[1]**2+d[0]**2:
ans.append("YES")
else:
ans.append("NO")
for i in range(N):
print(ans[i]) | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,715 |
s350844782 | p00003 | u123687446 | 1480651149 | Python | Python3 | py | Accepted | 40 | 7532 | 148 | n = int(input())
for i in range(n):
nums = sorted(map(int, input().split()))
print("YES" if nums[2]**2 == nums[1]**2 + nums[0]**2 else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,716 |
s357526223 | p00003 | u166860661 | 1480770398 | Python | Python | py | Accepted | 20 | 6312 | 245 | #coding: utf-8
n = raw_input()
a = []
for i in range(int(n)):
l = map(int,raw_input().split())
a.append(l)
for l in a:
l = [x * x for x in l]
l.sort()
if l[0] + l[1] == l[2]:
print 'YES'
else:
print 'NO' | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,717 |
s093727359 | p00003 | u301729341 | 1480863928 | Python | Python3 | py | Accepted | 40 | 7492 | 184 | N = int(input())
for i in range(N):
a,b,c = map(int,input().split())
if a*a + b*b == c*c or b*b+c*c == a*a or a*a+c*c == b*b:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,718 |
s708297519 | p00003 | u435300817 | 1480900784 | Python | Python3 | py | Accepted | 40 | 7808 | 327 | cnt = int(input())
values = []
for i in range(cnt):
values.append([int(x) for x in input().split()])
for x, y, z in values:
if z ** 2 == x ** 2 + y ** 2:
print('YES')
elif x ** 2 == y ** 2 + z ** 2:
print('YES')
elif y ** 2 == x ** 2 + z ** 2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,719 |
s378891950 | p00003 | u811733736 | 1481117384 | Python | Python3 | py | Accepted | 30 | 7852 | 471 | if __name__ == '__main__':
# ??????????????\???
num = int(input())
triangles = []
for i in range(num):
triangles.append([int(x) for x in input().split(' ')])
# ??´?§?????§???¢?????????????????????
results = []
for t in triangles:
t.sort()
if t[0]**2 + t[1]**2 == t[2]**2:
results.append('YES')
else:
results.append('NO')
# ???????????????
for r in results:
print(r) | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,720 |
s140730030 | p00003 | u796112608 | 1481182765 | Python | Python3 | py | Accepted | 40 | 7800 | 380 | triangle = []
n = int(input())
for i in range(n):
try:
(a,b,c) = input().split(" ")
triangle.append((a,b,c))
except:
break
for (a,b,c) in triangle:
if (int(a)**2 + int(b)**2 == int(c)**2) or (int(b)**2 + int(c)**2 ==int(a)**2) or (int(a)**2 + int(c)**2 == int(b)**2) :
print("YES")
else:
print("NO")
| p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,721 |
s091741074 | p00003 | u890722286 | 1481543225 | Python | Python3 | py | Accepted | 40 | 7548 | 361 | n = int(input())
for i in range(n):
a,b,c = list(map(int, input().split()))
M = max([a,b,c])
result = False
if a == M:
result = (a * a == b * b + c * c)
elif b == M:
result = (b * b == a * a + c * c)
elif c == M:
result = (c * c == a * a + b * b)
if result:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,722 |
s846091831 | p00003 | u923668099 | 1482105788 | Python | Python3 | py | Accepted | 50 | 7616 | 210 | # coding: utf-8
# Here your code !
n = int(input())
for _ in range(n):
a = [int(i) ** 2 for i in input().split()]
if max(a) == (sum(a) - max(a)):
print("YES")
else:
print("NO")
| p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,723 |
s076212765 | p00003 | u661290476 | 1483000749 | Python | Python3 | py | Accepted | 40 | 7672 | 136 | n=int(input())
for _ in range(n):
a=sorted([int(i) for i in input().split()])
print("YES" if a[0]**2+a[1]**2==a[2]**2 else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,724 |
s047797043 | p00003 | u711765449 | 1483535562 | Python | Python3 | py | Accepted | 30 | 7772 | 324 | # -*- coding:utf-8 -*-
import sys
array = []
for i in sys.stdin:
array.append(i)
N = int(array[0])
for k in range(1,N+1):
x = array[k].split()
a, b, c = int(x[0]), int(x[1]), int(x[2])
if a**2 + b**2 == c**2 or b**2 + c**2 == a**2 or c**2 + a**2 == b**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,725 |
s928767630 | p00003 | u116766943 | 1483546796 | Python | Python | py | Accepted | 20 | 6236 | 279 | def main():
n = input()
for _ in range(0,n):
arr = map(int,raw_input().split())
arr.sort()
if arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1]:
print "YES"
else:
print "NO"
if __name__ == '__main__':
main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,726 |
s458541255 | p00003 | u078042885 | 1483855766 | Python | Python3 | py | Accepted | 40 | 7648 | 122 | for _ in range(int(input())):
a=sorted(map(int,input().split()))
print('YES' if a[0]**2+a[1]**2==a[2]**2 else'NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,727 |
s351292274 | p00003 | u622250518 | 1484269966 | Python | Python | py | Accepted | 20 | 6404 | 342 | # -*- coding: utf-8 -*-
n = int(raw_input())
#print n
while True:
try:
a = map(int, raw_input().split())
#print a
a.sort(reverse=True)
#print a
b, c, d = a
if (b * b) == ((c * c) + (d * d)):
print 'YES'
else:
print 'NO'
except EOFError:
break; | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,728 |
s773544535 | p00003 | u622250518 | 1484270892 | Python | Python | py | Accepted | 30 | 6316 | 177 | n = int(raw_input())
for i in xrange(n):
a = map(int, raw_input().split())
a.sort()
if a[0]**2 + a[1]**2 == a[2]**2:
print 'YES'
else:
print 'NO' | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,729 |
s840764588 | p00003 | u811841526 | 1485606413 | Python | Python3 | py | Accepted | 40 | 7672 | 282 | def is_triangle(x, y, z):
x, y, z = sorted([x, y, z])
return x**2 + y**2 == z**2
num = int(input())
for i in range(num):
x, y, z = map(int, input().split())
triangle = is_triangle(x, y, z)
if triangle:
print('YES')
else:
print('NO')
| p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,730 |
s923873629 | p00003 | u252414452 | 1485779249 | Python | Python | py | Accepted | 20 | 6348 | 214 | def to_i(e):
return int(e)
n = int(raw_input().rstrip())
for i in range(n):
a = sorted(map(to_i, raw_input().rstrip().split(" ")))
if a[0]*a[0]+a[1]*a[1] == a[2]*a[2]:
print "YES"
else:
print "NO" | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,731 |
s697972187 | p00003 | u519227872 | 1486406660 | Python | Python3 | py | Accepted | 40 | 7600 | 160 | n = int(input())
for i in range(n):
h = list(map(int,input().split()))
h.sort()
if h[0]**2 ++ h[1]**2 == h[2]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,732 |
s349771674 | p00003 | u301461168 | 1487734553 | Python | Python3 | py | Accepted | 40 | 7628 | 416 | #1???????????????
num_data = int(input())
for i in range(num_data):
input_line = input().split(" ")
a = int(input_line[0])
b = int(input_line[1])
c = int(input_line[2])
#?????????????????????????????????????????§
if (pow(a,2) + pow(b,2) == pow(c,2) ) or (pow(a,2) + pow(c,2) == pow(b,2) ) or (pow(b,2) + pow(c,2) == pow(a,2)):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,733 |
s401833148 | p00003 | u831244171 | 1487837837 | Python | Python3 | py | Accepted | 40 | 7660 | 164 | N = int(input())
for i in range(N):
a = sorted(map(int,input().split()))
if a[0]**2 + a[1]**2 == a[2]**2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,734 |
s845113897 | p00003 | u630566146 | 1488470731 | Python | Python3 | py | Accepted | 40 | 7572 | 179 | N = int(input())
for i in range(N):
a, b, c = map(int,input().split())
if (a**2 + b**2 + c**2 - 2*(max(a,b,c)**2)) == 0:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,735 |
s688206750 | p00003 | u459418423 | 1488941955 | Python | Python3 | py | Accepted | 30 | 7604 | 265 | import sys
n = int(sys.stdin.readline().strip())
for i in range(n):
line = sys.stdin.readline()
lengths = sorted(list(map(int, line.strip().split())))
if lengths[0]**2 + lengths[1]**2 == lengths[2]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,736 |
s686242623 | p00003 | u901080241 | 1488948064 | Python | Python3 | py | Accepted | 50 | 7508 | 228 | n = int(input())
for i in range(n):
a = list(map(int, input().split()))
if a[0]**2 == a[1]**2 + a[2]**2 or a[1]**2 == a[2]**2 + a[0]**2 or a[2]**2 == a[0]**2 + a[1]**2 :
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,737 |
s570509289 | p00003 | u810591206 | 1488963019 | Python | Python3 | py | Accepted | 40 | 7472 | 182 | n = int(input())
for i in range(n):
l = list(map(int,input().split()))
l.sort()
if l[0] ** 2 + l[1] ** 2 == l[2] ** 2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,738 |
s070218689 | p00003 | u318658123 | 1489392033 | Python | Python3 | py | Accepted | 40 | 7600 | 605 | #coing:utf-8
def distance(a,b):
dst = pow(a,2) + pow(b,2)
return dst
def isTriangle(lines):
idxList = [[0,1,2],[1,0,2],[2,0,1]]
flag = False
for i in idxList:
if not flag and pow(lines[i[0]],2) == distance(lines[i[1]], lines[i[2]]):
flag = True
return flag
if __name__ == '__main__':
num = int(input())
results = []
for i in range(num):
lines = [int(item) for item in input().split(" ")]
results.append(isTriangle(lines))
for r in results:
if r:
print("YES")
else :
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,739 |
s476082508 | p00003 | u921541953 | 1489393890 | Python | Python3 | py | Accepted | 40 | 7748 | 256 | data = []
n = int(input())
for i in range(n):
data.append(list(map(int, input().split())))
data[i] = sorted(data[i])[::-1]
for j in range(n):
if data[j][0]**2 == data[j][1]**2 + data[j][2]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,740 |
s149823105 | p00003 | u623894175 | 1489483499 | Python | Python3 | py | Accepted | 40 | 7540 | 206 | deta_set_count = int(input())
for _ in range(deta_set_count):
k = list(map(int, input().split()))
k= sorted(k)
if k[0]**2 + k[1]**2 == k[2]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,741 |
s634499833 | p00003 | u897625141 | 1489826722 | Python | Python3 | py | Accepted | 40 | 7836 | 362 | n = int(input())
array = [[int(i) for i in input().split()] for i in range(n)]
for i in range(n):
if array[i][0]**2+array[i][1]**2 == array[i][2]**2:
print("YES")
elif array[i][0]**2+array[i][2]**2 == array[i][1]**2:
print("YES")
elif array[i][1]**2+array[i][2]**2 == array[i][0]**2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,742 |
s090464863 | p00003 | u011621222 | 1490019758 | Python | Python | py | Accepted | 20 | 6436 | 126 | n=input()
for i in range(n):
l=map(int,raw_input().split())
l.sort()
if l[0]**2+l[1]**2==l[2]**2:print"YES"
else:print"NO" | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,743 |
s689209071 | p00003 | u073709667 | 1490465764 | Python | Python3 | py | Accepted | 40 | 7676 | 192 | n=int(input())
for j in range(n):
l =input().split()
a=[int(l[i]) for i in range(3)]
a=sorted(a)
if a[0]**2+a[1]**2==a[2]**2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,744 |
s117988567 | p00003 | u036236649 | 1490593671 | Python | Python3 | py | Accepted | 40 | 7616 | 225 | N = int(input())
for i in range(N):
a, b, c = map(int, input().split())
if(a > c):
a, c = c, a
if(b > c):
b, c = c, b
if(c**2 == a**2 + b**2):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,745 |
s147828035 | p00003 | u728901930 | 1490777552 | Python | Python3 | py | Accepted | 50 | 7740 | 196 | import sys
n=int(input())
for i in range(n):
list=input().split()
list=[int(j) for j in list]
list.sort()
if list[0]*list[0]+list[1]*list[1]==list[2]*list[2]:
print("YES")
else:print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,746 |
s788382627 | p00003 | u462831976 | 1490851560 | Python | Python3 | py | Accepted | 40 | 7700 | 266 | # -*- coding: utf-8 -*-
import sys
import os
N = int(input())
for i in range(N):
lst = list(map(int, input().split()))
mx = max(lst)
lst.remove(mx)
if mx * mx == lst[0] * lst[0] + lst[1] * lst[1]:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,747 |
s774705417 | p00003 | u873302699 | 1490959723 | Python | Python | py | Accepted | 20 | 6440 | 263 | def my_func(i):
return i*i
raw_input()
while True:
try:
splited = map(int, raw_input().split())
sort_num = sorted(splited)
if my_func(sort_num[0])+my_func(sort_num[1]) == my_func(sort_num[2]):
print 'YES'
else:
print 'NO'
except EOFError:
break | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,748 |
s405381741 | p00003 | u371289566 | 1491220191 | Python | Python3 | py | Accepted | 40 | 7520 | 151 | N = int(input())
for i in range(N):
l = list(map(int,input().split()))
l.sort()
if l[0]*l[0]+l[1]*l[1] == l[2]*l[2]: print("YES")
else: print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,749 |
s145903146 | p00003 | u307520683 | 1491889678 | Python | Python | py | Accepted | 10 | 6180 | 173 | N = int(input())
for i in range(N):
a = map(int,raw_input().split())
a.sort()
if a[0]**2 + a[1]**2 == a[2]**2:
print "YES"
else:
print "NO" | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,750 |
s040962236 | p00003 | u078042885 | 1492064434 | Python | Python3 | py | Accepted | 30 | 7428 | 97 | for _ in[0]*int(input()):a,b,c=sorted(map(int,input().split()));print(['NO','YES'][a*a+b*b==c*c]) | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,751 |
s820954740 | p00003 | u957680575 | 1492168664 | Python | Python3 | py | Accepted | 40 | 7524 | 220 | N = int(input())
for i in range(N):
a = list(map(int, input().split()))
a = sorted(a)
x = a[0]
y = a[1]
z = a[2]
if x**2 + y**2 == z**2:
print("YES")
else:
print("NO")
| p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,752 |
s233347515 | p00003 | u000317780 | 1493735504 | Python | Python3 | py | Accepted | 30 | 7600 | 307 | # coding:utf-8
def main():
N = int(input().rstrip())
for i in range(N):
ls = list(map(int, input().split(' ')))
ls.sort()
if(ls[0]**2 + ls[1]**2 == ls[2]**2):
print('YES')
else:
print('NO')
if __name__ == "__main__":
main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,753 |
s288722789 | p00003 | u710016128 | 1493859580 | Python | Python3 | py | Accepted | 30 | 7676 | 369 | n = int(input())
ans = list()
for i in range(n):
line = input().split(" ")
a = float(line[0])
b = float(line[1])
c = float(line[2])
if ((a**2 + b**2) == c**2) or ((b**2 + c**2) == a**2) or ((c**2 + a**2) == b**2):
ans.append("YES")
else:
ans.append("NO")
for j in range(n):
print(ans[j]) | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,754 |
s533704034 | p00003 | u618637847 | 1494292449 | Python | Python3 | py | Accepted | 40 | 7644 | 354 | import sys
import math
for line in sys.stdin:
a = line.split()
if len(a) == 3:
if (int(a[0])*int(a[0]) + int(a[1])*int(a[1])) == int(a[2])*int(a[2]) or (int(a[0])*int(a[0]) + int(a[2])*int(a[2])) == int(a[1])*int(a[1]) or (int(a[2])*int(a[2]) + int(a[1])*int(a[1])) == int(a[0])*int(a[0]):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,755 |
s387381752 | p00003 | u717959831 | 1494292712 | Python | Python3 | py | Accepted | 40 | 7576 | 244 | import sys
for line in range(int(input())):
str = input().split(" ")
nums = sorted([int(str[2]), int(str[1]), int(str[0])])
if nums[2]*nums[2] == nums[1]*nums[1] + nums[0]*nums[0]:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,756 |
s424916898 | p00003 | u319774425 | 1494311489 | Python | Python | py | Accepted | 10 | 6292 | 316 | N = input()
a = []
for i in range(N):
a.append(map(int, raw_input().split()))
for j in range(N):
x = a[j][0] ** 2
y = a[j][1] ** 2
z = a[j][2] ** 2
if x == y + z:
print "YES"
elif y == x + z:
print "YES"
elif z == x + y:
print "YES"
else:
print "NO" | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,757 |
s254787235 | p00003 | u362104929 | 1494590700 | Python | Python3 | py | Accepted | 40 | 7564 | 425 | def main():
n = int(input())
while True:
try:
num_list = [int(i) for i in input().split()]
num_list = sorted(num_list)
a,b,c = num_list[0],num_list[1],num_list[2]
if (a**2 + b**2) == c**2:
print("YES")
else:
print("NO")
except EOFError:
break
return None
if __name__ == '__main__':
main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,758 |
s363626914 | p00003 | u123596571 | 1494650860 | Python | Python3 | py | Accepted | 40 | 7528 | 138 | n = int(input())
for _ in range(n):
num = sorted(map(int, input().split()))
print("YES" if num[2]**2 == num[1]**2 + num[0]**2 else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,759 |
s707967034 | p00003 | u922489088 | 1496013528 | Python | Python3 | py | Accepted | 30 | 7688 | 198 | import sys
N = int(sys.stdin.readline().rstrip())
for i in range(N):
l1,l2,l3 = sorted(map(int, sys.stdin.readline().rstrip().split(' ')))
print("YES" if (l1**2 + l2**2 == l3**2) else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,760 |
s646674977 | p00003 | u905313459 | 1496057189 | Python | Python3 | py | Accepted | 40 | 7704 | 193 | N = int(input())
for i in range(N):
p = input()
li = sorted([int(i) for i in p.split(" ")])
if li[-1]**2 == li[-2]**2 + li[-3]**2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,761 |
s005573426 | p00003 | u421983421 | 1496060840 | Python | Python | py | Accepted | 20 | 6236 | 239 | def righttriangle(a, b, c):
if c * c == a * a + b * b:
return 'YES'
else:
return 'NO'
n = int(raw_input())
for i in range(0, n):
inpt = map(int, raw_input().split())
inpt.sort()
print righttriangle(inpt[0], inpt[1], inpt[2])
| p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,762 |
s441184068 | p00003 | u974788383 | 1496149853 | Python | Python3 | py | Accepted | 40 | 7612 | 306 | #! /usr/bin/env python3
noOfInputs = int(input())
for i in range(noOfInputs):
numsInStr = input().split()
nums = []
for n in numsInStr:
nums.append(int(n))
largest = max(nums)
nums.remove(max(nums))
#print(nums)
if (largest**2 == sum([i**2 for i in nums])):
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,763 |
s762135947 | p00003 | u440180827 | 1496825313 | Python | Python3 | py | Accepted | 40 | 7476 | 202 | N = int(input())
for i in range(N):
sides = list(map(int, input().split()))
sides.sort()
if sides[0] ** 2 + sides[1] ** 2 == sides[2] ** 2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,764 |
s505874643 | p00003 | u440180827 | 1496825332 | Python | Python3 | py | Accepted | 40 | 7584 | 202 | N = int(input())
for i in range(N):
sides = list(map(int, input().split()))
sides.sort()
if sides[0] ** 2 + sides[1] ** 2 == sides[2] ** 2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,765 |
s326547245 | p00003 | u440180827 | 1496825528 | Python | Python3 | py | Accepted | 30 | 7520 | 230 | N = int(input())
for i in range(N):
a, b, c = map(int, input().split())
a2 = a ** 2
b2 = b ** 2
c2 = c ** 2
if a2 + b2 == c2 or a2 + c2 == b2 or b2 + c2 == a2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,766 |
s272442673 | p00003 | u844704750 | 1498733925 | Python | Python3 | py | Accepted | 40 | 7540 | 206 | n = int(input())
for i in range(n):
a, b, c = list(map(int, input().split()))
if min(a*a+b*b, min(a*a+c*c, c*c+b*b)) == max(a*a, max(b*b, c*c)):
print ("YES")
else:
print ("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,767 |
s450295114 | p00003 | u144068724 | 1499015312 | Python | Python3 | py | Accepted | 30 | 7880 | 241 | # coding: utf-8
# Here your code !
n = int(input())
e = [[int(i) for i in input().split()] for i in range(n)]
for i in e:
a = max(i)
i.remove(a)
if a*a == i[0]*i[0]+ i[1]*i[1]:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,768 |
s070695956 | p00003 | u340500592 | 1499404282 | Python | Python3 | py | Accepted | 40 | 7700 | 225 | N = int(input())
for i in range(N):
sides = list(map(int, input().split()))
longestSide = max(sides)
sides.remove(longestSide)
if (longestSide ** 2) == (sides[0] ** 2 + sides[1] ** 2):
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,769 |
s452343627 | p00003 | u600821328 | 1499863478 | Python | Python3 | py | Accepted | 40 | 7664 | 371 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def is_right(a, b, c):
a2 = a*a
b2 = b*b
c2 = c*c
return a2==b2+c2 or b2==c2+a2 or c2==a2+b2
def main():
N = int(input())
for _ in range(N):
a, b, c = map(int, input().split())
result = is_right(a, b, c)
print("YES" if result else "NO")
if __name__ == "__main__": main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,770 |
s168995666 | p00003 | u806182843 | 1500207787 | Python | Python3 | py | Accepted | 60 | 7748 | 408 | def main():
n = int(input())
for _ in range(n):
len_list = map(int, input().split())
check_tri(len_list)
def check_tri(len_list):
import itertools
import math
flag = False
for tmp in list(itertools.permutations(len_list)):
if (pow(tmp[0], 2) + pow(tmp[1], 2)) == pow(tmp[2], 2):
flag = True
break
if flag == True:
print('YES')
else:
print('NO')
if __name__ == '__main__':
main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,771 |
s736528712 | p00003 | u546285759 | 1500342687 | Python | Python3 | py | Accepted | 50 | 7600 | 136 | N = int(input())
for _ in range(N):
a, b, c = sorted(list(map(int, input().split())))
print("YES" if a*a + b*b == c*c else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,772 |
s840753801 | p00003 | u546285759 | 1500342890 | Python | Python3 | py | Accepted | 40 | 7604 | 130 | N = int(input())
for _ in range(N):
a, b, c = sorted(map(int, input().split()))
print("YES" if a*a + b*b == c*c else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,773 |
s155829561 | p00003 | u914146430 | 1500344995 | Python | Python3 | py | Accepted | 40 | 7512 | 184 | N=int(input())
for i in range(N):
hens=list(map(int, input().split()))
hens.sort()
if hens[0]**2+hens[1]**2==hens[2]**2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,774 |
s464012043 | p00003 | u011621222 | 1500444659 | Python | Python3 | py | Accepted | 40 | 7628 | 175 | for i in range(int(input())):
a = [int(i) for i in input().split(' ')]
a.sort()
if a[0]**2 + a[1]**2 == a[2]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,775 |
s219417336 | p00003 | u503263570 | 1501136053 | Python | Python3 | py | Accepted | 40 | 7504 | 141 | n=int(input())
for i in range(n):
x=list(map(int,input().split()))
a,b,c=sorted(x)
if a**2+b**2==c**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,776 |
s166041829 | p00003 | u503263570 | 1501136061 | Python | Python3 | py | Accepted | 40 | 7608 | 141 | n=int(input())
for i in range(n):
x=list(map(int,input().split()))
a,b,c=sorted(x)
if a**2+b**2==c**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,777 |
s344456419 | p00003 | u503263570 | 1501136065 | Python | Python3 | py | Accepted | 40 | 7636 | 141 | n=int(input())
for i in range(n):
x=list(map(int,input().split()))
a,b,c=sorted(x)
if a**2+b**2==c**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,778 |
s800969632 | p00003 | u350064373 | 1501247862 | Python | Python3 | py | Accepted | 30 | 7532 | 180 | n = int(input())
for i in range(0, n):
a,b,c = map(int, input().split())
if a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,779 |
s825893519 | p00003 | u498511622 | 1501248168 | Python | Python3 | py | Accepted | 40 | 7532 | 179 | s=int(input())
for i in range(0,s):
a,b,c=map(int,input().split())
if a*a + b*b == c*c or a*a + c*c == b*b or c*c + b*b == a*a:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,780 |
s657322863 | p00003 | u354053070 | 1501674333 | Python | Python3 | py | Accepted | 40 | 7500 | 176 | n = int(input())
for i in range(n):
a, b, c = sorted(list(map(int, input().split())))
if c ** 2 == (a ** 2 + b ** 2):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,781 |
s371524511 | p00003 | u821624310 | 1502464060 | Python | Python3 | py | Accepted | 40 | 7600 | 201 | N = int(input())
for i in range(N):
a, b, c = map(int, input().split())
sort = sorted([a, b, c])
if sort[0]**2 + sort[1]**2 == sort[2]**2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,782 |
s004537325 | p00003 | u214404619 | 1502747869 | Python | Python3 | py | Accepted | 40 | 7648 | 217 | import sys;
for line in sys.stdin:
n = int(line);
for i in range(0, n):
a = [int(num) for num in input().split()];
a.sort();
if a[2] ** 2 == (a[0] ** 2) + (a[1] ** 2):
print('YES');
else:
print('NO'); | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,783 |
s174682804 | p00003 | u267909338 | 1502773566 | Python | Python3 | py | Accepted | 40 | 7600 | 204 | num = input()
for x in range(0, int(num)):
l = map(int, input().split())
lists = sorted(l)
if lists[2] ** 2 == lists[0] ** 2 + lists[1] ** 2:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,784 |
s822995507 | p00003 | u234052535 | 1502789215 | Python | Python3 | py | Accepted | 50 | 7724 | 221 | for i in range(0, int(input())):
sidelen = [int(j) for j in input().split(" ")]
sidelen.sort(reverse=True)
if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,785 |
s034189952 | p00003 | u234052535 | 1502789628 | Python | Python3 | py | Accepted | 30 | 7764 | 275 | import sys
for i in sys.stdin:
try:
sidelen = [int(j) for j in i.split(" ")]
sidelen.sort(reverse=True)
if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2):
print("YES")
else:
print("NO")
except:
continue | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,786 |
s271783622 | p00003 | u234052535 | 1502789987 | Python | Python3 | py | Accepted | 30 | 7708 | 340 | import sys
for i in sys.stdin:
try:
sidelen = [int(j) for j in i.split(" ")]
if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2 or sidelen[1]**2 == sidelen[0]**2 + sidelen[2]**2 or sidelen[2]**2 == sidelen[0]**2 + sidelen[1]**2):
print("YES")
else:
print("NO")
except:
continue | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,787 |
s681694688 | p00003 | u234052535 | 1502790042 | Python | Python3 | py | Accepted | 40 | 7648 | 275 | import sys
for i in sys.stdin:
try:
sidelen = [int(j) for j in i.split(" ")]
sidelen.sort(reverse=True)
if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2):
print("YES")
else:
print("NO")
except:
continue | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,788 |
s685191600 | p00003 | u299798926 | 1502859876 | Python | Python3 | py | Accepted | 40 | 7648 | 184 | a=int(input())
for i in range(a):
x,y,z=[int(i) for i in input().split() ]
if (x*x==z*z+y*y)or(y*y==z*z+x*x)or(z*z==x*x+y*y):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,789 |
s023668568 | p00003 | u724606305 | 1502934553 | Python | Python3 | py | Accepted | 40 | 7544 | 178 | N=int(input())
for i in range(N):
a, b, c = map(int, input().split())
if(a*a==b*b+c*c or b*b==a*a+c*c or c*c==b*b+a*a):
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,790 |
s510744015 | p00003 | u193453446 | 1503459875 | Python | Python3 | py | Accepted | 30 | 7568 | 324 | def main():
""" ????????? """
num = int(input())
for i in range(num):
m = list(map(int,input().split()))
m.sort()
a = (m[0] ** 2) + (m[1] ** 2)
b = (m[2] ** 2)
if a == b:
print("YES")
else:
print("NO")
if __name__ == '__main__':
main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,791 |
s081193036 | p00003 | u428982301 | 1503652686 | Python | Python3 | py | Accepted | 50 | 7624 | 413 |
def check(a, b, c):
a2 = a ** 2
b2 = b ** 2
c2 = c ** 2
if (a2 + b2) == c2:
return True
else:
return False
n = int(input())
for c in range(n):
line = input()
datas = map(int, line.split())
li = list(datas)
a = li[0]
b = li[1]
c = li[2]
if check(a, b, c) or check(b, c, a) or check(c, a, b):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,792 |
s080481777 | p00003 | u855694108 | 1504079868 | Python | Python3 | py | Accepted | 30 | 7916 | 333 | def main():
N = int(input())
a = []
for _ in range(N):
a.append(list(map(int, input().split())))
for x in range(N):
a[x].sort(reverse = True)
if a[x][0] ** 2 == a[x][1] ** 2 + a[x][2] ** 2:
print("YES")
else:
print("NO")
if __name__ == "__main__":
main() | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,793 |
s965120497 | p00003 | u123964252 | 1504085585 | Python | Python3 | py | Accepted | 40 | 7900 | 184 | n = int(input())
data = [sorted(map(int, input().split(' '))) for i in range(n)]
for d in data:
if d[0]**2 + d[1]**2 == d[2]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,794 |
s037458597 | p00003 | u957021183 | 1504683261 | Python | Python3 | py | Accepted | 40 | 7756 | 324 | # Aizu Problem 0003: Is it a Right Triangle?
#
import sys, math, os
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
N = int(input())
for __ in range(N):
a, b, c = sorted([int(_) for _ in input().split()])
print("YES" if c**2 == a**2 + b**2 else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,795 |
s835481247 | p00003 | u525269094 | 1505106670 | Python | Python3 | py | Accepted | 60 | 7920 | 318 | # coding: utf-8
# Here your code !
import sys
import math
r = sys.stdin.readlines()
n = [[int(i) for i in (j.split())] for j in r]
for i in range(1,n[0][0]+1):
sq = []
for a in n[i]: #a is lengthes
sq.append(a**2)
if (sum(sq)-2*max(sq) == 0):
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,796 |
s357608364 | p00003 | u877201735 | 1505663701 | Python | Python3 | py | Accepted | 40 | 7568 | 190 | n = int(input())
for i in range(0, n):
data = sorted(list(map(int, input().split(' '))))
if data[2]**2 == data[1]**2 + data[0]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,797 |
s504122210 | p00003 | u741801763 | 1505723085 | Python | Python3 | py | Accepted | 50 | 7728 | 280 | if __name__ == "__main__":
n = int(input().strip().split()[0])
for i in range(n):
data = list(map(int,input().strip().split()))
c = max(data)
data.remove(c)
a,b = data
if a **2 + b ** 2 == c**2 :print("YES")
else:print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,798 |
s010781114 | p00003 | u933096856 | 1505793639 | Python | Python3 | py | Accepted | 40 | 7568 | 170 | n=int(input())
for i in range(n):
a=list(map(int, input().split()))
a.sort()
if a[2]**2 == a[1]**2+a[0]**2:
print('YES')
else:
print('NO') | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,799 |
s615992460 | p00003 | u197615397 | 1506151871 | Python | Python3 | py | Accepted | 40 | 7652 | 151 | import math
N = int(input())
for _ in [0]*N:
x = sorted(map(int, input().split()))
print("YES" if x[2] == math.sqrt(x[0]**2+x[1]**2) else "NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,800 |
s003574380 | p00003 | u531482846 | 1506200961 | Python | Python3 | py | Accepted | 30 | 7656 | 174 | import sys
n = input()
for _ in range(int(n)):
a, b, c = sorted(map(int, sys.stdin.readline().split()))
if a * a + b*b == c* c:
print("YES")
else:
print("NO") | p00003 |
<H1>Is it a Right Triangle?</H1>
<p>
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ length of the side ≤ 1,000</li>
<li> <var>N</var> ≤ 1,000</li>
</ul>
<H2>Output</H2>
<p>
For each data set, print "<span>YES</span>" or "<span>NO</span>".
</p>
<H2>Sample Input</H2>
<pre>
3
4 3 5
4 3 6
8 8 8
</pre>
<H2>Output for the Sample Input</H2>
<pre>
YES
NO
NO
</pre>
| 3
4 3 5
4 3 6
8 8 8
| YES
NO
NO
| 2,801 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.