This page is still under construction.

Parts of this page are still being built. What you see may change.

Triangle Classification

Interview

Time limit1sMemory limit128 MB

Summary
For each of T triples of side lengths, output whether it is equilateral, isosceles, scalene, or not a triangle.
Level

Easy2 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Ggung learned about triangles at school today. Triangles are grouped by their side lengths.

  • An equilateral triangle has three sides of the same length. All three angles are 60 degrees.
  • An isosceles triangle has two sides of the same length. Two of its angles are also equal.
  • A scalene triangle has three sides of different lengths, and all three angles differ. Some scalene triangles are right triangles.

The math teacher assigned homework: classify a triangle from its three side lengths. Ggung would much rather go play, so do the homework for him.

Input

The first line contains the number of test cases TT (1≤T≤1001 \le T \le 100).

Each of the next TT lines contains three space-separated integers AA, BB, CC (1≤A,B,C≤1,000,0001 \le A, B, C \le 1{,}000{,}000), the three sides of a triangle.

Output

For each test case print one line in the form Case #x: type, where xx is the test case number starting at 1 and type is the kind of triangle.

If the three lengths form a triangle, print equilateral, isosceles, or scalene. Otherwise print invalid!. The lengths form a triangle only when the longest side is shorter than the sum of the other two. If the two values are equal, it is not a triangle.

Examples1

  1. Example 1

    Input
    2
    3 3 4
    6 4 2
    
    Expected output
    Case #1: isosceles
    Case #2: invalid!