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 video games 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 form a valid non-degenerate triangle with integer side lengths.

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

Output Specification

For each of the T questions, output A if the triangle formed is acute, R if the triangle formed is right, or 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


  • -1
    QiQi  commented on Oct. 23, 2021, 2:58 a.m. edit 4

    Personally it's mostly Plasmatic's fault, and it's not a good idea to cheat.

    P.S. why did they chose Plasmatic as his name?


  • 12
    Summation  commented on Aug. 7, 2021, 2:54 p.m. edited

    With a 100\,000 question test, it's no wonder Plasmatic wants a program to do this for him...