Triangle

Interview

Time limit2sMemory limit128 MB

Summary
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.

  1. If the three points are collinear, they do not form a triangle. Print X.
  2. If all three side lengths are equal, the triangle is equilateral. Print JungTriangle.
  3. If exactly two side lengths are equal, the triangle is isosceles.
    1. If the largest angle is greater than 90 degrees, print Dunkak2Triangle.
    2. If the largest angle is exactly 90 degrees, print Jikkak2Triangle.
    3. If the largest angle is less than 90 degrees, print Yeahkak2Triangle.
  4. If all three side lengths are different, the triangle is scalene.
    1. If the largest angle is greater than 90 degrees, print DunkakTriangle.
    2. If the largest angle is exactly 90 degrees, print JikkakTriangle.
    3. If the largest angle is less than 90 degrees, print YeahkakTriangle.

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.

Examples3

  1. Example 1

    Input
    0 0
    -3 -3
    -3 0
    
    Expected output
    Jikkak2Triangle
    
  2. Example 2

    Input
    1 1
    0 0
    2 100
    
    Expected output
    DunkakTriangle
    
  3. Example 3

    Input
    10000 10000
    2580 2580
    -10000 -10000
    
    Expected output
    X