題目來源:judgegirl from ntu prof. pangfeng Liu
Task Description
Given the three coordinates of three vertices of a triangle, determine whether it is an isosceles triangle, an acute triangle, an obtuse triangle, or a right triangle. Here we assume that all coordinates are integers. Note that if an triangle is an isosceles triangle, you cannot report it as an acute triangle nor a right triangle. To avoid lose of accuracy it is strongly suggested that you compute the three squares of the length of sides, rather than to compute the length. Suppose the square of the longest side is , then you can determine the shape of the triangle by comparing it with and , which are the squares of the other two sides.
平面上座標上,給定三角形的三個頂點座標,決定是否為等腰、銳角、鈍角或者是直角三角形。你可以假設所有座標皆為整數。特別注意,如果一個三角形為等腰三角形,那麼就不必回報它是否為銳角或鈍角。
為了防止計算誤差,若需要紀錄三角形的三邊長,最好使用其邊長的平方儲存,假設三邊長由長到短分別為 , , ,那麼只需要比較 , , 之間的關係即可得到。
Input format
The first line contains one integer, , indicate the number of input cases below. The following are lines, each contains six integers, , which are the three coordinates of three vertices of the triangle. Each integer is non-negative and less than 1,000. All the input data will form a triangle correctly.
Output format
For each case, print the type of the triangle, isosceles
, acute
, obtuse
, or right
.
Sample input
4
0 0 1 1 1 0
0 0 1 3 3 0
0 0 1 1 3 0
0 0 1 2 1 0
Sample output
isosceles
acute
obtuse
right