Question: Either Python or Java is OK! Thank you ! Achilles and the Tortoise are locked in a game of tag, with the Tortoise currently being


Either Python or Java is OK! Thank you !
Achilles and the Tortoise are locked in a game of tag, with the Tortoise currently being "it."This means he must catch Achilles. After playing his favorite computer game, Portal, the Tortoise designed himself a portal gun to assist him. Achilles is at location A on some long 1-dimensional road, the Tortoise at location T (and they cannot stray from the road). In one minute, starting from location L, the Tortoise can walk 1 unit forward or backward, or use its portal gun to travel to 2L: L{L+1, L- 1,2L You job is to find the minimum number of minutes it will take to Tortoise to reach Achilles, assuming Achilles does not move the entire time Input Format A single line containing the integers T and A. For example if the Tortoise starts at location 12 and Achilles at 200: 12 200 Constraints 0 A 100,000 0 T S 100,000 Output Format A single line solely with the the minimum number of minutes for the Tortoise to reach Achilles. For example if it takes the Tortoise a minimum of 5 minutes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
