Solved NCPC 2011, Problem D: Elevator Trouble