King loves to go on tours with his friends.King has 𝑁N cars that can seat 55 people each and 𝑀M cars that can seat 77 people each. Determine the maximum number of people that can travel together in these cars.Input FormatThe first line of input contains a single integer 𝑇T, the number of test cases.The first and only line of each test case contains two space-separated integers 𝑁N and 𝑀M — the number of 55-seaters and 77-seaters, respectively.Output FormatFor each test case, output on a new line the maximum number of people that can travel together.Constraints1≤𝑇≤1001≤T≤1000≤𝑁,𝑀≤1000≤N,M≤100Sample 1:InputOutput44 82 1314 58 87610110596Explanation:Test case 11: King has 44 cars that seat 55 each and 88 cars that seat 77 each. So, 4×5+8×7=764×5+8×7=76 people can travel together.Test case 22: King has 22 cars that seat 55 each and 1313 cars that seat 77 each. So, 2×5+13×7=1012×5+13×7=101 people can travel together.Test case 33: King has 1414 cars that seat 55 each and 55 cars that seat 77 each. So, 14×5+7×7=10514×5+7×7=105 people can travel together.Test case 44: King has 88 cars that seat 55 each and 88 cars that seat 77 each. So, 8×5+8×7=968×5+8×7=96 people can travel together.
Question
King loves to go on tours with his friends.King has 𝑁N cars that can seat 55 people each and 𝑀M cars that can seat 77 people each. Determine the maximum number of people that can travel together in these cars.Input FormatThe first line of input contains a single integer 𝑇T, the number of test cases.The first and only line of each test case contains two space-separated integers 𝑁N and 𝑀M — the number of 55-seaters and 77-seaters, respectively.Output FormatFor each test case, output on a new line the maximum number of people that can travel together.Constraints1≤𝑇≤1001≤T≤1000≤𝑁,𝑀≤1000≤N,M≤100Sample 1:InputOutput44 82 1314 58 87610110596Explanation:Test case 11: King has 44 cars that seat 55 each and 88 cars that seat 77 each. So, 4×5+8×7=764×5+8×7=76 people can travel together.Test case 22: King has 22 cars that seat 55 each and 1313 cars that seat 77 each. So, 2×5+13×7=1012×5+13×7=101 people can travel together.Test case 33: King has 1414 cars that seat 55 each and 55 cars that seat 77 each. So, 14×5+7×7=10514×5+7×7=105 people can travel together.Test case 44: King has 88 cars that seat 55 each and 88 cars that seat 77 each. So, 8×5+8×7=968×5+8×7=96 people can travel together.
Solution
Para resolver este problema, sigamos los siguientes pasos:
- Leer el número de casos de prueba, .
- Para cada caso de prueba, leer los valores de y .
- Calcular el número máximo de personas que pueden viajar juntas usando la fórmula:
- Imprimir el resultado para cada caso de prueba.
Aquí está el procedimiento paso a paso:
- Leer el número de casos de prueba, ( T \
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'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.
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.
There is a group of 𝑁N friends who wish to enroll in a course together. The course has a maximum capacity of 𝑀M students that can register for it. If there are 𝐾K other students who have already enrolled in the course, determine if it will still be possible for all the 𝑁N friends to do so or not.Input FormatThe first line contains a single integer 𝑇T - the number of test cases. Then the test cases follow.Each test case consists of a single line containing three integers 𝑁N, 𝑀M and 𝐾K - the size of the friend group, the capacity of the course and the number of students already registered for the course.Output FormatFor each test case, output Yes if it will be possible for all the 𝑁N friends to register for the course. 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≤N≤M≤1000≤𝐾≤𝑀0≤K≤MSample 1:InputOutput32 50 275 40 38100 100 0YesNoYesExplanation:Test Case 1: The 22 friends can enroll in the course as it has enough seats to accommodate them and the 2727 other students at the same time.Test Case 2: The course does not have enough seats to accommodate the 55 friends and the 3838 other students at the same time.
Multiple Choice QuestionIdentify the sentence in which the number is correctly expressed.Multiple choice question.That bus can carry only one hundred fifty people safely.That bus can carry only 150 people safely.150 people is the maximum the bus can carry safely.
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.