Appleby Contest '20 P1 - Terrific Triangles

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Python 3.0s
Memory limit: 256M

Author:
Problem type

Plasmatic is having a test on the different types of triangles! However, he is unable to answer any questions because he was playing videogames in online classes. He vaguely remembers that the teacher taught 3 types of triangles -- acute, right and obtuse, but he doesn't remember how to identify any of them. He doesn't want to fail the test, so he needs your help to write a program to solve his problems.

Input Specification

The first line contains T (1 \le T \le 10^5), the number of questions.

Each of the following T lines contains l_1, l_2, l_3 (1 \le l_1, l_2, l_3 \le 10^9), the side lengths of the triangle. It is guaranteed that the three side lengths forms a valid non-degenerate triangle.

For test worth 30\% of the score, there will be no acute triangles.

Output Specification

For of the T, output A if the triangle formed is acute, R if the triangle formed is right, O if the triangle formed is obtuse.

Sample Input 1

2
5 12 13
5 11 13

Sample Output 1

R
O

Sample Input 2

3
2 3 4
2 2 2
3 4 5

Sample Output 2

O
A
R

Comments

There are no comments at the moment.