Description: The parking lot is a long and narrow passageway that can park n cars, and only one gate can be used to enter and exit the car. Car in the parking lot vehicle in the order of arrival time of from north to south in order to arrange (gate at the southern tip of the first to arrive the extreme north of the first car parked in the yard), if the car floor has stopped full n car, the car later have to wait outside the door of the pavement, once have a car, ranked first car can drive into the sidewalk; When a car in the parking lot to leave, after it into the vehicle must withdraw from the yard to make way for the it, opened the car door, other vehicles to enter the yard, according to the original order per car parked in the yard when it left the parking lot must be fees it stay for the length of time. Try to prepare a simulation program for the parking lot according to the above requirements.
To Search:
File list (Check if you may need any files):