Determine whether three side lengths can form a triangle, and if so, classify the triangle by its side equality.
You are given three positive integers representing the lengths of three segments.
Determine whether these segments can form a non-degenerate triangle. If they can, classify the triangle as:
If the segments cannot form a triangle, report that it is Impossible.
A triangle is valid only if the sum of any two side lengths is strictly greater than the third side.
Print one of the following:
EquilateralIsoscelesScaleneImpossibleExample 1
Input
3 4 5
Output
Scalene
Explanation
The sides satisfy the triangle inequality, and all three lengths are different.
Example 2
Input
2 2 3
Output
Isosceles
Explanation
The three sides can form a triangle, and exactly two sides are equal.
Example 3
Input
1 2 3
Output
Impossible
Explanation
The sum of the two smaller sides is not greater than the largest side.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.