Knowee
Questions
Features
Study Tools

Four friends want to attend a concert. Each ticket costs 𝑋X rupees.They have decided to go to the concert if and only if the total cost of the tickets does not exceed 10001000 rupees.Determine whether they will be going to the concert or not.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single integer 𝑋X, the cost of each ticket.Output FormatFor each test case, output YES if they will be going to the concert, NO otherwise.You can print each character in uppercase or lowercase. For example, the strings YES, yes, Yes, and yES, are all considered identical.Constraints1≤𝑇≤1001≤T≤1001≤𝑋≤10001≤X≤1000Sample 1:InputOutput41005002501000YESNOYESNOExplanation:Test case 11: The total cost of all tickets is 100⋅4=400100⋅4=400 which is ≤1000≤1000. Thus, they will go to the concert.Test case 22: The total cost of all tickets is 500⋅4=2000500⋅4=2000 which is >1000>1000. Thus, they will not go to the concert.Test case 33: The total cost of all tickets is 250⋅4=1000250⋅4=1000 which is ≤1000≤1000. Thus, they will go to the concert.Test case 44: The total cost of all tickets is 1000⋅4=40001000⋅4=4000 which is >1000>1000. Thus, they will not go to the concert.

Question

Four friends want to attend a concert. Each ticket costs 𝑋X rupees.They have decided to go to the concert if and only if the total cost of the tickets does not exceed 10001000 rupees.Determine whether they will be going to the concert or not.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single integer 𝑋X, the cost of each ticket.Output FormatFor each test case, output YES if they will be going to the concert, NO otherwise.You can print each character in uppercase or lowercase. For example, the strings YES, yes, Yes, and yES, are all considered identical.Constraints1≤𝑇≤1001≤T≤1001≤𝑋≤10001≤X≤1000Sample 1:InputOutput41005002501000YESNOYESNOExplanation:Test case 11: The total cost of all tickets is 100⋅4=400100⋅4=400 which is ≤1000≤1000. Thus, they will go to the concert.Test case 22: The total cost of all tickets is 500⋅4=2000500⋅4=2000 which is >1000>1000. Thus, they will not go to the concert.Test case 33: The total cost of all tickets is 250⋅4=1000250⋅4=1000 which is ≤1000≤1000. Thus, they will go to the concert.Test case 44: The total cost of all tickets is 1000⋅4=40001000⋅4=4000 which is >1000>1000. Thus, they will not go to the concert.

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The problem is asking to determine if four friends can attend a concert based on the cost of the tickets. The total cost of the tickets should not exceed 1000 rupees.

Here's how to

Similar Questions

There are 𝑁N students including Chef in a school. The school bus has 𝑀M seats, and every student in the school travels on the bus.It is guaranteed that 𝑁≤𝑀N≤M, so that everyone will have a seat.Chef is happy when the school bus is not full.Given 𝑁N and 𝑀M, your task is to find out whether Chef will be happy.Input FormatThe only line of input will contain two space-separated integers 𝑁N and 𝑀M, denoting the number of students in the school and the number of seats in the school bus respectively.Output FormatFor each test case, output on a new line the answer: YES, if Chef will be happy, and NO otherwise.You may print each character of the string in uppercase or lowercase (for example, the strings YeS, yEs, yes, and YES will all be treated as identical).Constraints1≤𝑁≤𝑀≤101≤N≤M≤10Sample 1:InputOutput2 3YESExplanation:There are 22 students and 33 seats on the bus.So, there will be one empty seat on the bus and Chef will be happy.Sample 2:InputOutput6 6NOExplanation:There are 66 students and 66 seats on the bus.The bus will be full and Chef will not be happy.

Chef and his girlfriend went on a date. Chef took 𝑋X dollars with him, and was quite sure that this would be enough to pay the bill. At the end, the waiter brought a bill of 𝑌Y dollars. Print "YES" if Chef has enough money to pay the bill, or "NO" if he has to borrow from his girlfriend and leave a bad impression on her.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single line of input, containing two space-separated integers 𝑋X and 𝑌Y.Output FormatFor each test case, output on a new line "YES" if Chef has enough money to pay the bill 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).Constraints1≤𝑇≤1001≤T≤1001≤𝑋,𝑌≤1001≤X,Y≤100Sample 1:InputOutput41 11 22 150 100YESNOYESNOExplanation:Test case 11: Since the money Chef has is equal to the bill, he will be able to pay the bill.Test case 22: Since the money Chef has is less than the bill, he will have to borrow from his girlfriend and leave a bad impression on her.Test case 33: Since the money Chef has is greater than the bill, he will be able to pay the bill.Test case 44: Since the money Chef has is less than the bill, he will have to borrow from his girlfriend and leave a bad impression on her.

Alice has scored 𝑋X marks in her test and Bob has scored 𝑌Y marks in the same test. Alice is happy if she scored at least twice the marks of Bob’s score. Determine whether she is happy or not.Input FormatThe first and only line of input contains two space-separated integers 𝑋,𝑌X,Y — the marks of Alice and Bob respectively.Output FormatFor each testcase, print Yes if Alice is happy and No if she is not, according to the problem statement.The judge is case insensitive so you may output the answer in any case. In particular YES, yes, yEsare all considered equivalent toYes`.Constraints1≤𝑋,𝑌≤1001≤X,Y≤100Sample 1:InputOutput2 1YesExplanation:Alice has scored 𝑋=2X=2 marks whereas Bob has scored 𝑌=1Y=1 mark. As Alice has scored twice as much as Bob (i.e. 𝑋≥2𝑌X≥2Y), the answer is Yes.

Chef's son wants to go on a roller coaster ride. The height of Chef's son is 𝑋X inches while the minimum height required to go on the ride is 𝐻H inches. Determine whether he can go on the ride or not.Input FormatThe first line contains a single integer 𝑇T - the number of test cases. Then the test cases follow.The first and only line of each test case contains two integers 𝑋X and 𝐻H - the height of Chef's son and the minimum height required for the ride respectively.Output FormatFor each test case, output in a single line, YES if Chef's son can go on the ride. Otherwise, output NO.You may print each character of YES and NO in uppercase or lowercase (for example, yes, yEs, Yes will be considered identical)Constraints1≤𝑇≤10001≤T≤10001≤𝑋,𝐻≤1001≤X,H≤100Sample 1:InputOutput415 2050 4832 3238 39NOYESYESNOExplanation:Test case 1: Chef's son can not go on the ride as his height << the minimum required height.Test case 2: Chef's son can go on the ride as his height ≥≥ the minimum required height.Test case 3: Chef's son can go on the ride as his height ≥≥ the minimum required height.Test case 4: Chef's son can not go on the ride as his height << the minimum required height.

Bob received an assignment from his school: he has two numbers 𝐴A and 𝐵B, and he has to find the sum of these two numbers.Alice, being a good friend of Bob, told him that the answer to this question is 𝐶C.Bob doesn't completely trust Alice and asked you to tell him if the answer given by Alice is correct or not.If the answer is correct print "YES", otherwise print "NO" (without quotes).Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.The first and only line of each test case consists of three space-separated integers 𝐴,𝐵,A,B, and 𝐶C.Output FormatFor each test case, output on a new line the answer: YES if Alice gave the right answer, and NO otherwise.Each character of the output may be printed in either uppercase or lowercase, i.e, the outputs Yes, YES, yEs and yes will be treated as equivalent.Constraints1≤𝑇≤1001≤T≤1000≤𝐴,𝐵,𝐶≤1000≤A,B,C≤100Sample 1:InputOutput31 2 34 5 92 3 6YESYESNOExplanation:Test case 11: 1+2=31+2=3, so Alice's answer is correct.Test case 22: 4+5=94+5=9, so Alice's answer is correct.Test case 33: 2+3=52+3=5 which doesn't equal 66, so Alice's answer is incorrect.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.