[Solution] Scalene Triangle CodeChef Solution
Problem
Given and as the sides of a triangle, find whether the triangle is scalene.
Note:
- A triangle is said to be scalene if all three sides of the triangle are distinct.
- It is guaranteed that the sides represent a valid triangle.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of three space-separated integers and — the length of the three sides of the triangle.
Output Format
For each test case, output on a new line, YES
, if the triangle is scalene, and NO
otherwise.
You may print each character of the string in uppercase or lowercase. For example, YES
, yes
, Yes
, and yEs
are all
considered identical.
Explanation:
Test case : The side lengths are and . Since no two side lengths are equal, the triangle is scalene.
Test case : The side lengths are and . The sides and have the same length. Thus, the triangle is not scalene.
Test case : The side lengths are and . The sides and have the same length. Thus, the triangle is not scalene.
Test case : The side lengths are and . Since no two side lengths are equal, the triangle is scalene.
No comments:
Post a Comment