#K69457. Triangle Classification

    ID: 33090 Type: Default 1000ms 256MiB

Triangle Classification

Triangle Classification

In this problem, you are given three integers (a), (b), and (c) which represent the side lengths of a potential triangle. Your task is to determine whether these sides can form a valid triangle. A valid triangle must satisfy the triangle inequality: (a + b > c), (a + c > b), and (b + c > a). If the sides do not satisfy these conditions, output "Not a triangle". Otherwise, classify the triangle as follows:

  1. If all three sides are equal, output "Equilateral".
  2. If exactly two sides are equal, output "Isosceles".
  3. If all three sides are distinct, output "Scalene".

The input is given as multiple lines. Each line contains three integers separated by spaces. The input terminates when a line with "0 0 0" is encountered; this line should not be processed. Your solution must read from standard input and output the result for each test case to standard output, each on a new line.

inputFormat

The input consists of multiple lines. Each line contains three space-separated integers (a), (b), and (c) representing the side lengths. The sequence of input lines terminates with a line containing "0 0 0", which should not be processed.

outputFormat

For each test case, output a single line indicating the type of the triangle. The possible outputs are:

  • Equilateral
  • Isosceles
  • Scalene
  • Not a triangle## sample
3 3 3
3 4 5
2 2 3
0 0 0
Equilateral

Scalene Isosceles

</p>