A structural engineer has three straight steel beams and wants to bolt their ends together to form a single rigid triangular truss. Given the lengths of the three beams, first decide whether they can actually be joined into a valid triangle at all (three lengths can form a triangle only if the sum of any two of them strictly exceeds the third). If they cannot, report that. Otherwise, classify the resulting truss by its beam lengths: 'equilateral' if all three beams are the same length, 'isosceles' if exactly two of the three beams share a length (but not all three), and 'scalene' if all three beam lengths are different.
A single line containing three space-separated integers a, b, c: the lengths of the three beams.
Print exactly one of the following words: 'equilateral', 'isosceles', 'scalene', or 'none' (if the three beams cannot form a valid triangle).
Example 1
Input
4 4 4
Expected
equilateral
Explanation
4+4>4 for every pair, so the beams form a valid triangle, and all three lengths are equal, so the truss is 'equilateral'.
Example 2
Input
1 2 5
Expected
none
Explanation
The two shorter beams sum to 1+2=3, which is not greater than the third beam's length of 5, so the beams cannot be joined into any triangle: output 'none'.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →