More than sure that such a problem exists, perhaps even in summary form. Please tell me what it's called.
The task is:
You need to make a program of watching TV.
Each show has the following fields:
start time, end time, room, priority.
You need to in each moment, looked the most priority telecast.