Maximum Capacity CodeChef Solution

We Are Discuss About CODECHEF SOLUTION

Maximum Capacity CodeChef Solution

Maximum Capacity CodeChef Solution

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
JoinScishowEngineerTelegram

Problem

A building lift has a maximum capacity of 500 kilograms.
However, due to the pandemic, at most 8 people can use the lift at once.

There are � friends, each having a weight of � kilograms. Find whether all of them can use the lift at once.

Input Format

  • The first line of input will contain a single integer �, denoting the number of test cases.
  • Each test case contains two space-separated integers � and � — the number of friends and the weight of each friend.

Output Format

For each test case, output on a new line, YES, if all friends can use the lift at once. Otherwise, output NO.

You may print each character in uppercase or lowercase. For example, NO, no, No, and nO, are all considered the same.

Constraints

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

Sample 1:

Input

Output

4
7 75
8 50
10 10
5 100
NO
YES
NO
YES

Explanation:

Test case 1: The total weight of all friends is 7⋅75=525. Since the total weight is greater than the maximum capacity, all of them cannot use the lift at once.

Test case 2: The total weight of all friends is 8⋅50=400. Since the number of friends is ≤8 and the total weight is less than the maximum capacity, all of them can use the lift at once.

Test case 3: The total number of friends is greater than 8. Thus, all of them cannot use the lift at once.

Test case 4: The total weight of all friends is 5⋅100=500. Since the number of friends is ≤8 and the total weight is ≤ maximum capacity, all of them can use the lift at once.

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
JoinScishowEngineerTelegram

 

SOLUTION

Here Discuss About Solve Maximum Capacity CodeChef Solution

SOLUTION

Maximum Capacity 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. Required fields are marked *