# Maximum Capacity CodeChef Solution

### We Are Discuss About CODECHEF SOLUTION

Maximum Capacity CodeChef Solution

## 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.

## 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.