The customer support group of Contest.comreceives and responds to requests for technical support via e-mail. Requestsmay begin arriving when the office opens at 8:00 a.m. and all requests must beserviced by the end of the day.
As requests are received, they areclassified according to a predetermined list of topics. Each member of thesupport staff has responsibility for one or more of these topics and each topichas one or more support personnel assigned to it. Because staff members havedifferent levels of expertise, each staff member has a prioritized list oftopics that he or she can handle. Staff personnel are not permitted to handlerequests outside their specified areas.
As staff members become available, theyselect from the pool of waiting requests according to their priority list oftopics. All requests arriving at time t are available for allocation at time t.If two staff members are simultaneously available, scheduling preference isgiven to the one whose most recent job was scheduled earliest. If there isstill a tie, scheduling preference is given to the person whose id numberappears earlier in the input list of staff people. At the opening of business,all personnel are available to handle requests.
You have been asked to perform a preliminaryanalysis of the technical support environment based on a number of differentscenarios. For each scenario, information will be given about the mix ofrequests and the division of labor among the staff. For each topic, you willgiven the average number of requests per day for that topic, the averageelapsed time before the first of these requests is received, the average timebetween requests for this topic, and the average time needed to service therequest. All times are given in minutes. You will also be given a list ofsupport personnel and, for each one, a list of the topics for which he or shehas responsibility. (Since data are based on estimates, factors such as coffeebreaks, lunch, computer failures, etc., can be ignored.)
Input consists of a number of scenarios.Each scenario begins with the number of request topics, a positive integer nolarger than 20. This is followed by a description of each topic. Eachdescription consists of five integer values: a unique topic identifier, the numberof requests for that topic, the elapsed time before the first request for thattopic is received, the time needed to service a request, and the time betweensuccessive requests. All but the third of these values are positive integers;the elapsed time until the first request could be zero. Following this, thenumber of personnel is given. This will be a positive integer not to exceed 5.Finally, a description of each person is given in the form of three or morepositive integer values: a unique identifying number for the person, the numberof topics covered by this person, and a list of the topic identifiers arrangedfrom highest priority to lowest priority for that person. A zero follows thelast scenario.
For each scenario, the output consists ofthe scenario number followed by the statement, "All requests are servicedwithin m minutes.", where m is the number of minutes from the start of thebusiness day until the last request is serviced.
Sample Input | Output for the Sample Input |
3 | Scenario 1: All requests are serviced within 195 minutes. |