[Solution] Reach Home Solution Codechef

Reach Home Solution Codechef

Chef is hungry and wants to reach home.

Chef can travel up to 5 kilometres on 1 litre of fuel on his motorcycle.
Currently, his motorcycle is filled with  litres of fuel and his home is  kilometres away.

Determine whether Chef can reach his home on his motorcycle or not.

Input Format Reach Home Solution Codechef

  • The first line of input will contain a single integer , denoting the number of test cases.
  • The first and only line of each test case contains two space-separated integers  and  — the amount of fuel in Chef’s motorcycle and the distance to Chef’s home in kilometres.

Output Format Reach Home Solution Codechef

For each test case, output YES, if Chef can reach home on his motorcycle. Otherwise output NO.

You can output each character of the answer in uppercase or lowercase. For example, the strings yEsyesYes, and YES are considered the same.

Constraints Reach Home Solution Codechef

  • 1≤�≤100
  • 1≤�,�≤1000

Sample 1: Reach Home Solution Codechef

Input

Output

4
2 10
3 17
4 2
6 45
YES
NO
YES
NO

Explanation: Reach Home Solution Codechef

Test case 1: With 2 litres of fuel, Chef can go up to 10 kilometres. Since his home is 10 kilometres away, he can reach his home on his motorcycle.

Test case 2: With 3 litres of fuel, Chef can go up to 15 kilometres. Since his home is 17 kilometres away, he cannot reach his home on his motorcycle.

Test case 3: With 4 litres of fuel, Chef can go up to 20 kilometres. Since his home is 2 kilometres away, he can reach his home on his motorcycle.

Test case 4: With 6 litres of fuel, Chef can go up to 30 kilometres. Since his home is 45 kilometres away, he cannot reach his home on his motorcycle.

Leave a Comment