Triangle Classification

All submissions for this problem are available.
Read problems statements in Mandarin Chinese , Russian and Vietnamese as well.
Triangle classification is an important problem in modern mathematics. Mathematicians have developed many criteria according to which a triangle can be classified. In this problem, you will be asked to classify some triangles according to their sides and angles.
According to their measure, angles may be:
 Acute — an angle that is less than 90 degrees
 Right — a 90degrees angle
 Obtuse — an angle that is greater than 90 degrees
According to their sides, triangles may be:
 Scalene — all sides are different
 Isosceles — exactly two sides are equal
According to their angles, triangles may be:
 Acute — all angles are acute
 Right — one angle is right
 Obtuse — one angle is obtuse
Triangles with three equal sides (equilateral triangles) will not appear in the test data.
The triangles formed by three collinear points are not considered in this problem. In order to classify a triangle, you should use only the adjactives from the statement. There is no triangle which could be described in two different ways according to the classification characteristics considered above.
Input
The first line of input contains an integer SUBTASK_ID denoting the subtask id this input belongs to.
The second line of input contains an integer T denoting the number of test cases. The description of T test cases follows.
The only line of each test case contains six integers x_{1}, y_{1}, x_{2}, y_{2}, x_{3} and y_{3} denoting Cartesian coordinates of points, that form the triangle to be classified.
It is guaranteed that the points are noncollinear.
Output
For each test case, output a single line containing the classification of the given triangle.
If SUBTASK_ID equals 1, then the classification should follow the "<Side classification starting with a capital letter> triangle" format.
If SUBTASK_ID equals 2, then the classification should follow the "<Side classification starting with a capital letter> <angle classification> triangle" format.
Please, check out the samples section to better understand the format of the output.
Constraints
 1 ≤ T ≤ 60
 x_{i}, y_{i} ≤ 100
 Subtask 1 (50 points): no additional constraints
 Subtask 2 (50 points): no additional constraints
Note
The first test of the first subtask and the first test of the second subtask are the example tests (each in the corresponding subtask). It's made for you to make sure that your solution produces the same verdict both on your machine and our server.
Tip
Consider using the following condition in order to check whether two floats or doubles A and B are equal instead of traditional A == B: A  B < 10^{6}.
Example 1
Input: 1 2 0 0 1 1 1 2 3 0 0 4 4 7 Output: Scalene triangle Isosceles triangle
Example 2
Input: 2 6 0 0 4 1 1 3 0 0 1 0 1 2 0 0 1 1 1 2 0 0 2 1 1 2 3 0 0 4 4 7 0 0 2 1 4 0 Output: Scalene acute triangle Scalene right triangle Scalene obtuse triangle Isosceles acute triangle Isosceles right triangle Isosceles obtuse triangle
Author:  kostya_by 
Tester:  pavel1996 
Editorial  http://discuss.codechef.com/problems/TRIANGCL 
Tags  adhoc, basicmath, cakewalk, geometry, kostya_by, ltime32 
Date Added:  28122015 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions