1025 Department ?

topic:

Description
Security Department has a new headquarters building. The building has several layers, each layer has a number of rooms xxyy, wherein yy is the room number, floor number representative of XX, 0 <xx; yy <= 10. The building has a "pater-noster" elevators, the elevator i.e. built from a few running around the cabin. Agents must visit the headquarters from time to time. During their visit, they want to visit several rooms and in each room, they want to stay for some time. For security reasons, the same room can have only one agent, the same rule also applies to the elevator. These visits are planned manner to ensure completion within a day. Each delegate access headquarters once a day at most.
Each agents to enter the first floor of the building, through the reception desk, then began a visit to the room according to his / her list. Agents always access the room by increasing the room number. Agent to form a linear hierarchy, according to the hierarchical structure, they are assigned a single personal code letter. Agents with higher qualifications having a smaller code is lexicographically arranged. Two agents did not have the same code.
If more than one agency wants to enter the room or the elevator, the agent must form a queue. In each queue, they always stand in accordance with their code. The higher the agent's qualifications, the more he was near the top of the queue. Every 5 seconds (sec), the queue in front of the elevator in the elevator into the first agent. During a visit to the headquarters of the last room, each proxy will use the elevator to the first floor and leave the building if necessary.
Headquarters moves from a point to another point to the desired time is set as follows: enter the building, i.e., by receiving and reaches the elevator, floor or room needed 30 seconds. Leave the building, that is out of the elevator on the first floor of a room or reception and also by 30 seconds. On the same floor, is transferred from the elevator to the room (the room or in front of the queue), or from the room to the elevator (or to the front of the elevator queue), or from one room to another room (or queue in front of the room) need 10 second. Above or below the elevator is transferred from the layer to the next 30 seconds. Write a program that determines access time agents at headquarters.
Input
Input file contains the agent of n> = 0 Description of visits. The first row of each access agent described herein includes a character code C, C = A,.. . , Z, and agents to enter the headquarters of the time. The format is HH: MM: SS (hour, minute, second). The next line (at least one line) comprises a room number, and the length of time to stay in the room, the time in seconds. Each room is in a separate line. Rooms are classified according to a list of room numbers increase. 0 room list with a line containing end. Access list to describe the end of the line containing the character point.
Output
output contains a detailed record of each agent at the headquarters visit. For each agent, there will be one block. Block agent sorted in ascending order of the program code. Blocks separated by an empty line. After the last block has a blank line. The first row contains the agent code block. The next line contains the start and end time (format HH: MM: SS) and his / her activities described. Time data will be separated by a blank character. Description will be separated by a blank character and time. There will be described a form Entry, Exit or Message. Message can be one of the following: a queue waiting for the elevator, waiting room in front of the room number, room number transferred from room to room room number, room number transferred from the elevator to the room, move from room number to the elevator, living room in the room number, live in the elevator.
Sample input
A 10:00:00
0101 100
0110 50
0202 90
0205 50
0
B 10:01:00
0105 100
0201 5
0205 200
0
.
Sample Output
A
10:00:00 10:00:30 Entry
10:00:30 10:02:10 Stay in room 0101
10:02:10 10:02:20 Transfer from room 0101 to room 0110
10:02:20 10:03:10 Stay in room 0110
10:03:10 10:03:20 Transfer from room 0110 to elevator
10:03:20 10:03:50 Stay in elevator
10:03:50 10:04:00 Transfer from elevator to room 0202
10:04:00 10:05:30 Stay in room 0202
10:05:30 10:05:40 Transfer from room 0202 to room 0205
10:05:40 10:07:40 Waiting in front of room 0205
10:07:40 10:08:30 Stay in room 0205
10:08:30 10:08:40 Transfer from room 0205 to elevator
10:08:40 10:09:10 Stay in elevator
10:09:10 10:09:40 Exit

B
10:01:00 10:01:30 Entry
10:01:30 10:03:10 Stay in room 0105
10:03:10 10:03:20 Transfer from room 0105 to elevator
10:03:20 10:03:25 Waiting in elevator queue
10:03:25 10:03:55 Stay in elevator
10:03:55 10:04:05 Transfer from elevator to room 0201
10:04:05 10:04:10 Stay in room 0201
10:04:10 10:04:20 Transfer from room 0201 to room 0205
10:04:20 10:07:40 Stay in room 0205
10:07:40 10:07:50 Transfer from room 0205 to elevator
10:07:50 10:08:20 Stay in elevator
10:08:20 10:08:50 Exit

Guess you like

Origin www.cnblogs.com/sweet-ginger-candy/p/11518204.html