Triangle
InterviewTime limit2sMemory limit128 MB
Given three points, classify the triangle they form as degenerate, equilateral, isosceles or scalene, and further by its largest angle type.
- Level
Easy3 of 10
- Topics
- Geometry, Implementation, Math
- Solved
- No attempts yet
Problem
You are given three distinct points on a plane. Classify the figure determined by these points using the rules below.
- If the three points are collinear, they do not form a triangle. Print
X. - If all three side lengths are equal, the triangle is equilateral. Print
JungTriangle. - If exactly two side lengths are equal, the triangle is isosceles.
- If the largest angle is greater than 90 degrees, print
Dunkak2Triangle. - If the largest angle is exactly 90 degrees, print
Jikkak2Triangle. - If the largest angle is less than 90 degrees, print
Yeahkak2Triangle.
- If the largest angle is greater than 90 degrees, print
- If all three side lengths are different, the triangle is scalene.
- If the largest angle is greater than 90 degrees, print
DunkakTriangle. - If the largest angle is exactly 90 degrees, print
JikkakTriangle. - If the largest angle is less than 90 degrees, print
YeahkakTriangle.
- If the largest angle is greater than 90 degrees, print
Input
The first three lines each contain the x-coordinate and y-coordinate of one point, separated by a space. Every coordinate is an integer with absolute value at most 10,000, and the three points are distinct.
Output
Print the single string that matches the classification.