Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem B ( answer in python , c # , or javascript ) Bob Roberts is the self proclaimed Car Vet who owns several junk
Problem B answer in python c # or javascript
Bob Roberts is the self proclaimed "Car Vet" who owns several junk car lots where people can come and search for spare parts for their ailing cars. The cars in each lot are parked in a fencedin grid lot, where each car takes up two grid squares. Each lot also has zero or more grid locations devoted to piles of parts fenderstrack tape players, wheel covers, fuzzy dice, etc.; these locations are effectively blocked. Business has been so good that each of Bob's lots has only one empty grid space left.
From time to time, Bob or one of his lot attendants drops a part on the ground and it rolls underneath one of the cars. The only way to retrieve it is to move the car out of the way. Depending on the location of the empty grid space, it may be necessary to move several cars in order to achieve this. Cars can only move forward or backward, and car movement is also constrained by the fence, which prevents any car from moving off the lot, and by the blocked grid locations containing piles of parts.
Figure shows an example. An ambihelical hexnut has rolled under car number in row column of the grid shaded dark gray The space in row column is empty and the space in row column is blocked. The only way to retrieve the part is to move car then car then car Note that if the locations of the empty grid cell and the blocked grid cell were reversed, it would not be possible to retrieve the part.
Input
Input starts with a line containing two positive integers
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started