3682 - Triangle Quality

Created by Luis Manuel Díaz Barón
Added by luismo (2016-06-10)
Limits
Total Time: 3000 MS | Test Time: 1000 MS |Memory: 256 MB | Output: 64 MB | Size: 16 KB
Enabled languages
Available in

Description

The Triangle is a special figure that is useful for many applications in real life. One important property is that a triangle is the polygon with the minimum number of edges that can be formed. Since they are so important, they can be also classified by their quality.

Let's define the quality of a triangle as the triple product of the sum of the lengths of two of its sides minus the length of its third side, divided by the product of the lengths of its sides. Mathematically, the quality of a triangle with sides of lengths a, b, and c, can be expressed through the following formula:

TQ = ((b + c - a) * (a + b - c) * (c + a - b)) / (a * b * c)

According to its quality, a triangle is classified as:
  • Equilateral if TQ = 1
  • Good if 0.5 < TQ < 1
  • Bad if 0 < TQ  0.5
Your task is to determine the classification of a set of triangles.
El Triángulo es una figura especial con muchas utilidades en la vida real. Una propiedad importante es que el triángulo es el polígono con la menor cantidad de lados que se puede construir. Debido a que son tan importantes, los triángulos también se pueden clasificar por su calidad.

Podemos definir la calidad de un triángulo como el producto triple de las sumas de las longitudes de dos de sus lados menos la longitud del tercer lado, todo ello dividido por el producto de las longitudes de todos los lados. Matemáticamente, la calidad de un triángulo cuyas longitudes de sus lados son a, b, y c, se puede expresar mediante la siguiente fórmula:

TQ = ((b + c - a) * (a + b - c) * (c + a - b)) / (a * b * c)

De acuerdo a su calidad, un triángulo puede ser clasificado como:
  • Equilateral si TQ = 1
  • Good si 0.5 < TQ < 1
  • Bad si 0 < TQ  0.5
Su tarea consiste en determinar la clasificación de un conjunto de triángulos.
The Triangle is a special figure that is useful for many applications in real life. One important property is that a triangle is the polygon with the minimum number of edges that can be formed. Since they are so important, they can be also classified by their quality.

Let's define the quality of a triangle as the triple product of the sum of the lengths of two of its sides minus the length of its third side, divided by the product of the lengths of its sides. Mathematically, the quality of a triangle with sides of lengths a, b, and c, can be expressed through the following formula:

TQ = ((b + c - a) * (a + b - c) * (c + a - b)) / (a * b * c)

According to its quality, a triangle is classified as:
  • Equilateral if TQ = 1
  • Good if 0.5 < TQ < 1
  • Bad if 0 < TQ  0.5
Your task is to determine the classification of a set of triangles.

Input specification

In the first line of input, there is a single positive integer T (T 10000) denoting the number of test cases. Each of the next T lines contains three space separated integers a, b and c denoting the length of each side of the triangle. No side has length greater than 10000. It is guaranteed that the given values form a valid triangle.
En la primera línea de entrada, habrá un único entero positivo T (T 10000) que representa la cantidad de casos de prueba. Cada una de las siguientes T líneas contendrá tres números enteros a, b y c separados por un espacio; representan las longitudes de cada lado del triángulo. Ningún lado tendrá una longitud mayor de 10000. Puede asumir con seguridad que las longitudes dadas representan un triángulo válido.
In the first line of input, there is a single positive integer T (T 10000) denoting the number of test cases. Each of the next T lines contains three space separated integers a, b and c denoting the length of each side of the triangle. No side has length greater than 10000. It is guaranteed that the given values form a valid triangle.

Output specification

Print exactly T lines, each one containing the corresponding classification of the given triangle in that test case. A classification should be one of the words "equilateral", "good" or "bad".
Usted debe imprimir exactamente T líneas, cada una contendrá la correspondiente clasificación para el triángulo dado en ese orden. La clasificación debe ser una de las palabras "equilateral", "good" o "bad".
In the first line of input, there is a single positive integer T (T 10000) denoting the number of test cases. Each of the next T lines contains three space separated integers a, b and c denoting the length of each side of the triangle. No side has length greater than 10000. It is guaranteed that the given values form a valid triangle.

Sample input

3
2 2 2
6292 4360 7232
1744 8725 9107

Sample output

equilateral
good
bad

Hint(s)