Given 3 numbers N , L and R. Print 'yes' if N is between L and R else print 'no'.

Given 3 numbers N , L and R. Print 'yes' if N is between L and R else print 'no'.
Sample Testcase :
INPUT
3
2 6
OUTPUT
yes


const readline = require('readline');
const inp = readline.createInterface({
  input: process.stdin
});
const userInput = [];
inp.on("line", (data) => {
userInput.push(data);
});
inp.on("close", () =>
{var a = parseInt(userInput[0]);
 var b = (userInput[1]);
 var c= b.split(" ")
 if(+c[0]<a &&  a+c[1])
 console.log("yes")
 else
 console.log("no")
 });

Comments

Popular posts from this blog

Kabali is a brave warrior who with his group of young ninjas moves from one place to another to fight against his opponents. Before Fighting he just calculates one thing, the difference between his ninja number and the opponent's ninja number. From this difference he decides whether to fight or not. Kabali's ninja number is never greater than his opponent.

Given 2 numbers N,M. Print 'yes' if their product is a perfect square else print 'no'.

Given 2 numbers N and M add both the numbers and check whether the sum is odd or even.