You are to simulate the movements of an elevator in a building, which works according to the following rules: The building has only three stories. The elevator stays 3 seconds for customers to get in or get out. If some customers want to get in and some want to get out, the elevator stays 6 seconds. It takes the elevator 2 seconds to go one story upwards or downwards. When there is no request for service, the elevator stays where it is. Namely, it is idle. When the elevator is idle, and a request comes from upwards or downwards, it moves upwards or downwards. If a request comes from the story where it stays, the elevator opens its door to serve these customers. When the elevator goes upwards or downwards, it keeps its direction until there is no request from upwards or downwards. However, it breaks off to let customers get out or pick up customers if necessary. If the elevator is to go upwards or downwards, it does not accept customers intending to go upwards or downwards. When the elevator can act more than one way according to aforementioned rules, it chooses the action with the highest priority. The priorities for actions, from the highest to the lowest, are: let customers get out let customers get in go upstairs go downstairs Initially (at time 0), the elevator is in the 1th story, and it is idle. Given the requests, you are to output how the elevator moves in a designated interval. Suppose that each request comes at an integer second. Input Each of the lines in the input file consists of three numbers, N1, N2, and N3, representing a request coming from N2th story to N3th story at time N1. Output You have to output what the elevator acts at each second in the designated interval. Sample Input 1 2 1 3 2 4 1 3 5 2 1 6 3 1 9 2 1 10 Output for the Sample Input 0: idle at story 1 1: let customer1 get in at story 1 4: going up to 2 4: customer2 waiting at story 3 5: customer3 waiting at story 1 6: let customer1 get out at story 2 6: customer4 waiting at story 2 9: going up to 3 9: customer5 waiting at story 3 10: customer6 waiting at story 2 11: let customer2 and customer5 get in 14: going down to 2 16: let customer2 get out 19: let customer4 and customer6 get in 22: going down to 1 24: let customer4, customer5, customer6 get out 27: let customer3 get in 30: going up to 3 34: let customer3 get out 37: idle at story 3
## Deliverables
Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.
## Platform
Windows