adplus-dvertising

Passes For Fair CodeChef Solution

We Are Discuss About CODECHEF SOLUTION

Passes For Fair CodeChef Solution

Passes For Fair CodeChef Solution

There is a fair going on in Chefland. Chef wants to visit the fair along with his NN friends. Chef manages to collect KK passes for the fair. Will Chef be able to enter the fair with all his NN friends?

A person can enter the fair using one pass, and each pass can be used by only one person.

Input Format

  • The first line of input will contain a single integer¬†TT, denoting the number of test cases.
  • Each test case consists of a single line containing two space-separated integers¬†N,KN,K.

Output Format

For each test case, print on a new line YES if Chef will be able to enter the fair with all his NN friends and NO otherwise.

You may print each character of the string in either uppercase or lowercase (for example, the strings yEs, yes, Yes, and YES will all be treated as identical).

Passes For Fair CodeChef Solution

Constraints

  • 1‚ȧT‚ȧ1001‚ȧT‚ȧ100
  • 1‚ȧN,K‚ȧ1001‚ȧN,K‚ȧ100

Sample Input 1 

4
5 8
6 3
2 2
1 2

Sample Output 1 

YES
NO
NO
YES

Explanation

Passes For Fair CodeChef Solution

Test case 11: Chef needs 55 passes for his friends and one pass for himself and he collected 88 passes. Thus he will be able to enter the fair with all his friends.

Test case 22: Chef needs 66 passes for his friends and one pass for himself while he collected only 33 passes. Thus he will not be able to enter the fair with all his friends, only three of them can enter the fair.

Test case¬†33:¬†Chef needs¬†22¬†passes for his friends and one pass for himself while he collected only¬†22¬†passes. Thus either Chef or one of his friends can’t enter the fair.

Test case 44: Chef needs a total of 22 passes, one for himself and one for his friend. He collected 22 passes. Thus he will be able to enter the fair with his friend.

SOLUTION

Passes For Fair CodeChef Solution

SOLUTION

Passes For Fair CodeChef Solution

SOLUTION

Yhaa You have done it but next? if YOU Want to Get Others Please Visit Here ScishowEngineer   Then Follow US HERE and Join Telegram.

If You Want To Learn Something New Then Visit Our Official Channel YOUTUBE

Related Posts

Leave a Reply

Your email address will not be published.