Is it Triangle ?

Description

Given the lengths of 3 sticks, find out if it is possible to form a triangle of a positive area. (Non-Degenerate Triangle).

Note: Please implement the solution with the help of a function, any other solution will be discarded.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 1000) — the number of test cases. Then t test cases follow.

The first line of each test case contains 3 integers a,b,c (1 ≤ a,b,c ≤ 100) — the lengths of the 3 sticks.

Output

For each test case, print the answer: "Yes" if possible, else "No".

Sample Input 1 

4
4 5 13
7 1 8
2 5 4
2 2 2

Sample Output 1

No
No
Yes
Yes
Answer
function validTriangle(abc){
    if (a<(b+c) && b<(a+c) && c<(a+b)){
        return true;
    }
        return false;
}

// INPUT 
function runProgram(input) {
    var arr = input.split("\n");
    var cases = Number(arr[0]);
    for(var i = 1i<= casesi++){
        var sides = arr[i].split(" ").map(Number);
        var valid = validTriangle(sides[0], sides[1], sides[2]);
        if(valid) {
            console.log("Yes");
        } else {
            console.log("No")
        }

    }

}

Comments

Popular posts from this blog

Multer file upload and delete - Nodejs, Mongodb, Express

Money Management

Sub array quest IX