All submissions for this problem are available.
Theres a football match going to be held in a stadium. There are lots of spectators waiting outside the stadium. Your job is to place them in the STANDS. The STANDS have fixed capacity, an Integer STRENGTH. You plan to divide the GROUP of spectators into two HALF smaller groups, and keep on dividing the smaller groups as well until you get groups that can fit in the STANDS. While dividing groups you have to make sure if it has odd number of spectators then one smaller group will contain one more spectator than the other. Your have to print the number of stands that will be filled in stadium.
The first of line of input contains an integer T(number of test cases)
The following T lines , each contain two integers separted by space,first TOTAL number of spectators and second STRENGTH of a stand.
For each test print the number of stands that will be filled in a new line.
Should contain all the constraints on the input data that you may have. Format it like:
- 1 ≤ Number of spectators ≤ 1000000
- 1 ≤ STRENGTH of a stand ≤ 1000000
Input: 2 16 4 5 1 Output: 4 5
In first case there will be four subgroups of each strength 4.
In second case 5 subgroups of 1 strength each.
|Time Limit:||5 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CAML, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.