The grand opening of the Collapsible Robot Museum is just 1 week away in the robot nation of Robotia. The museum is unique because shortly after the museum closes, the building collapses into a flat plot of land and un-collapses prior to opening. Needless to say, any robot inside at the time of collapse will be destroyed. Normally, a wireless signal informing robots inside the structure of the closing would allow ample time for all to leave safely. The problem is that some robots may experience interference from all the exhibits and may not get the signal.
Fortunately, museum employee bots can also deliver the signal via direct interface, although this requires close range. The museum director is cheap, and only wants to hire 2 bots for each of the 4 sections (lined up in a row A,B,C,D) and has set up an automatic collapse system (to prevent robber bots from bribing their way in after hours). Wanting to avoid lawsuits, the director wants to know how long to set the timer after closing in order to ensure every robot (including the employees) is out of the building.
The following facts are known about the closing procedure:
- There will be at most 100 visitors still in the museum at closing time (everyone else has chronometers and leaves by then)
- The visitors are distributed throughout each of the 4 buildings, although each has at least 2 visitors.
- Each building has at least 1 visitor who receives the signal, and at least 1 who does not. All employees receive the signal.
- Any visitor who receives the signal proceeds immediately to the exit (at the front of A).
- Any visitor who does not receive the signal remains in place until an employee delivers it.
- It takes any robot 10 seconds to leave a building, regardless of where in the building they are (i.e. it takes 10 seconds to go from D to C, C to B, etc, and 10 seconds to go from A to the exit)
- Ten seconds after closing, the workers begin clearing robots within their building, taking a route such that every second, 1 visitor per employee receives the closing message (which takes negligible time).
- Once a building is clear of visitors, it takes the workers 10 seconds to verify that everyone is gone.
- When D is clear and verified, the workers from D move to C; once C is clear the 4 workers move to B, and so on.
- If A, B, or C clear first, 1 robot may go assist any other building; the other must stay behind to direct robots to the exit.
- The employees can coordinate to minimize the total time.
How long should the timer be set (to the nearest second) to ensure every robot is out, while minimizing the time the building stands empty?