Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | May 2017 |
Last Sign in: | 306 Weeks Ago, 1 Day Ago |
Questions Answered: | 66690 |
Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Our lovely chef once won a free holiday to the amazing Maldives. But after reaching there he found out that the island which was next to him was better than his current, but unfortunately there was no bridge through which he can go to that island. Since he was very creative he found out a way to create a bridge between the two islands
There were infinite wooden plank of mass M and length L on the chef's island. Now you have to calculate at least how many planks he will require to create a bridge between two island if the distance between those two island is W.
The first line of the input contains an integer T denoting the number of test cases, for each test case input L i.e. length of planks and W distance between islands.
For each test case, output a single line with minimum number of planks required to make bridge.
Â
Input: 2 4 5 10 9 Output: 7 1
Â
Case 1 : for L = 4m and W = 5m , bridge can be constructed using minimum of 7 planks.
Case 2 : for L = 10m and W = 9m , bridge can be constructed using only single planks.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll