Tanushree and Bills Problem Code: ANSHU11 Answer

Tanushree and Bills Problem Code: ANSHU11 Code SMASH! » Tanushree and Bills

Tanushree and Bills

Problem Code: ANSHU11


Add problem to Todo list
Submit
Tanushree went to a restaurant to eat food and since is a big foodie she is having difficulties choosing which cuisine she would like to eat but ultimately she ended up buying a N-number of dishes which may or may not be out of her budget, fortunately, her debit card was offering 10% off on bills more than 1000.

If the quantity, budget, and the price of individual dishes are the input calculate whether the bill will be out of her budget or not.

NOTE: The budget may or may not be an Integer take Input accordingly.

Input Format

First line will contain T, number of testcases. Then the testcases follow.
Each testcase contains of a single line of input, two integers N,B.
Then the next N lines contains the the price of the individual dishes that Tanushree has ordered

Output Format

For each testcase, output in a single line answer YES or NO

If Tanushree can afford all the dishes print "YES"
If Tanushree can't afford all the dishes print "NO"

Constraints

1≤T≤100
2≤N≤103
0≤B≤104

Sample Input 1 

3
3 600
250 210 120
4 1000
250 210 120 500
21 43
1 0 2 6 8 8 9 4 8 1 1 6 3 5 5 7 6 8 3 7 4

Sample Output 1 

YES
YES
NO

Explanation

First test case explanation:- In the first test case as we can see Tanushree has bought 3 dishes and her budget is 600 now her total bill is 250+210+120 which is 580 and it is less than her budget (580<=600) which means she will be able to afford the bill.

Second test case explanation:- Here as we can see Tanushree has ordered 4 dishes and the budget is 1000 the cost of all dishes should be 1080 but since she is getting a 10% discount from the bank on every transaction above 1000, the amount Tanushree needs to pay is 972 because of the discount. Now, since the amount Tanushree needs to pay is below her budget (972<=1000) she can actually afford all the food therefore the answer is YES.

3rd test case explanation:- We can apply the same logic explained above in both of the test cases




             


Post a Comment

0 Comments