SCPC11D - Egypt

A long time ago, the Egyptians figured out that a triangle with sides of length 3, 4, and 5 had a right angle as its largest angle. You must determine if other triangles have a similar property.

Input

Input represents several test cases, followed by a line containing 0 0 0. Each test case has three positive integers, less than 30,000, denoting the lengths of the sides of a triangle.

Output

For each test case, a line containing "right" if the triangle is a right triangle, and a line containing "wrong" if the triangle is not a right triangle.

Example

Input:
6 8 10
25 52 60
6 8 10 25 52 60 5 12 13 0 0 0
5 12 13
0 0 0
Output: right wrong right

Added by:Ali Arous
Date:2011-10-18
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Syrian Collegiate Programming Contest 2011

hide comments
2013-08-21 01:10:51 (Tjandra Satria Gunawan)(曾毅昆)
@Shekhar: Thanks for the "hint", my silly mistake :-P
2013-04-11 22:30:06 Francky
This was tutorial some times ago. I don't know how it came in classical. Back to tutorial.
2013-03-03 11:26:52 shashank
One of the most easiest problem in spoj
you should know about pythogores theorem in maths...
2013-02-11 14:58:17 Bhagwat
Very easy problem...:)
2012-12-22 16:22:33 Philipp Heeg
Use String.trim() in Java to correct the Input.
2012-11-11 17:09:14 £ukasz Zatorski
There are additional whitespace characters at the end of some lines (mostly TAB or something similar). Please keep some standards of input - people can try to submit results in various languages, and this can cause some hard to understand WAs.
2012-11-04 12:23:49 No_words
why NZEC in java ??? Same logic gives AC in python !
whats wrong ???

Last edit: 2012-11-04 12:37:41
2012-09-26 19:34:35 DEVANSH PARASHAR
sort the input
2012-08-04 00:15:47 a b
what if a triangle is not possible...caused me a wrong answers
2012-07-09 01:59:31 Mostafa 36a2
Look Men ... I Really Love SPOJ
18 WA
for a small little tiny wrong
:)

Last edit: 2012-07-09 02:01:08
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.