“Don’t practice until you get it right. Practice until you can’t get it wrong”
Bangladesh is the host country for the Annual ICPC World Finals 2021.
For a successful event arrangement, a volunteer training program has been arranged with many trainees. The season was full of some activities like leadership, fundamental skills of volunteers, problem-solving, decision-making, and different challenges of volunteering, etc. All the trainees were very attentive and took part in the activities spontaneously.
At the end of the event, snacks will be provided for everyone. Opera is the organizer of the food distribution system. Currently, she has dollars for food expenses. But she is not sure how many people will come for the snacks, so she wants to buy as many as snacks with the money she has for safety. Fortunately, a Buy 2 Get 1 Offer is running on pizza in a nearby shop. That means-
“If you purchase pizzas then you will get pizza for free”.
The price of one (1) mini-size -inch pizza is dollars.
Write a program to determine the maximum number of pizzas she can purchase from that shop. She can buy a pizza if and only if the total cost after purchasing that pizza does not exceed the dollar she has.
The first line of the input contains - the number of test cases. Then the following lines contain two integers and separated by spaces.
Output a single integer for each test case, the maximum number of pizzas Opera can purchase.
Input | Output |
---|---|
2 1000 250 515 250 | 6 3 |