Pro.ID21662 TitlePersonnel Scheduling Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21662 AC0 Submit0 Ratio- 时间&空间限制描述personnel scheduling has been widely studied for many years. The scheduling can be thought of as the problem of assigning employees to shifts or duties over a scheduling period so that certain constraints are satisfied or the assignment achieved some objective. In this problem, we focus on a basic personnel scheduling system. Suppose there is a small workshop which manufactures accessory for some special tools. This time, the workshop received a series of order forms in a day. Each order form gives out a period of time. For an order form, the workshop owner has to recruit one laborer to manipulate the machine. In this period, other order forms cannot distract the laborer. But when the laborer finished his current work, he can take over another order form. To minimize the cost, the workshop owner wants to recruit least amount of the laborers. Besides, he has to consider the work-time balance among the laborers — the deviation of the work-time of each laborer should also be minimal. The definition of the deviation D is that, suppose there are m laborers and their work-times are w1, w2, ..., wm, then Your task is to work out the minimum number of laborers to be recruited and the minimum deviation between these laborers. 输入The first line of the input gives out the number T ( T ≤ 100 ) of test case. For each test case, the first line is an integer N ( 1 ≤ N ≤ 20 ), representing the number of the order form. The following N lines each line contains two timestamps, "start-time" and "end-time". The format of a time forms "HH:MM" ( 0 ≤ HH < 24, 0 ≤ MM < 60 ). A laborer should be assigned to this period of time, start-time and end-time inclusive. 输出Description personnel scheduling has been widely studied for many years. The scheduling can be thought of as the problem of assigning employees to shifts or duties over a scheduling period so that certain constraints are satisfied or the assignment achieved some objective. In this problem, we focus on a basic personnel scheduling system. Suppose there is a small workshop which manufactures accessory for some special tools. This time, the workshop received a series of order forms in a day. Each order form gives out a period of time. For an order form, the workshop owner has to recruit one laborer to manipulate the machine. In this period, other order forms cannot distract the laborer. But when the laborer finished his current work, he can take over another order form. To minimize the cost, the workshop owner wants to recruit least amount of the laborers. Besides, he has to consider the work-time balance among the laborers — the deviation of the work-time of each laborer should also be minimal. The definition of the deviation D is that, suppose there are m laborers and their work-times are w1, w2, ..., wm, then Your task is to work out the minimum number of laborers to be recruited and the minimum deviation between these laborers. Input The first line of the input gives out the number T ( T ≤ 100 ) of test case. For each test case, the first line is an integer N ( 1 ≤ N ≤ 20 ), representing the number of the order form. The following N lines each line contains two timestamps, "start-time" and "end-time". The format of a time forms "HH:MM" ( 0 ≤ HH < 24, 0 ≤ MM < 60 ). A laborer should be assigned to this period of time, start-time and end-time inclusive. Output For each test case, output a line with two number m and D. D is rounded to 2 decimal places. Sample Input 2 Sample Output 2 0.00 Source 样例输入2 样例输出2 0.00 作者 |