index
| submit
| rank
| book

## triangle – Six Triangle Types (challenge)

Every triangle can be classified as either scalene, isosceles or equilateral:

*equilateral* triangles have all edges of the same size;
*isosceles* triangles have exactly two edges of the same size;
*scalene* triangles have three edges of different sizes.

(Some authors consider equilateral to be a special case of isosceles. For the
purpose of this exercise, we use Euclid’s original definition and consider
isosceles triangles those with *exactly* two edges of the same size.)

All triangles can also be classified as right, obtuse and acute:

*obtuse* triangles have one greater than 90° angle;
*right* triangles have a 90° angle;
*acute* triangles have three less than 90° angles.

Write a program that given three edge sizes determines:

- whether a triangle is
*scalene*, *isosceles* or *equilateral*; and
- whether a triangle is
*right*, *obtuse* or *acute*; or
- if the triangle is impossible.

### Input and Output

Input consists of a several lines,
each with three natural numbers *x*, *y* and *z*
where

0 < x, y, z < 10 000

For each line of input, output should contain a line indicating both classifications or `impossible`

.

#### Example input

```
3 4 5
3 3 1
6 4 3
1 1 1
7 2 3
```

#### Example output

```
scalene right
isosceles acute
scalene obtuse
equilateral acute
impossible
```

### Scoring

- 1/5: works for the above example but produces output in an incorrect format
- 2/5: works for the above example and produces output in the correct format
- 4/5: works for other test cases
- 5/5: works for edge cases

### Hints

If are having trouble to get a full score in this exercise,
try to come up with other test cases besides
the ones given on the example inputs.
Does your program still produce the expected results on them?
What if you change the order in which the sides are given?

try first: triangle1

try next: calc

index
| submit
| rank
| book

Copyright © 2020-2022 Rudy Matela

All rights reserved