Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Language: Busy Airport
Description Today is a busy day of Mehrabad Airport. There are a lot of aircrafts requesting to land but unfortunately, the number of available bands for landing is a few. As a result, a policy has been set to manage the landing aircrafts:
Input The first line of input consists of a single integer T, the number of test-cases. Each test-case starts with a line containing two integers, , 1 ≤ R ≤ 100 , the number of aircrafts requesting to land and 1 ≤ B ≤ 10, the number of available bands for landing. Each of the next R lines contains the description of the landing aircraft consisting of the aircraft ID (less than 10000000), the date of arrival (due to Persian Calendar ) in the format 'dd/mm/yyyy' where 1178 ≤ yyyy < 1634 , the time of initial request for landing in the format 'hh:mm:ss.uuu' in 24 hour format, and the time-span 'hh:mm:ss.uuu', guaranteed to be at most 2 hours, which is the amount of time needed for that aircraft to land. Output For each test case, your program should first output a line containing the phrase 'Report for Test-Case #k:', where k is the index of the test-case, followed by the report associated with it. Each line of the report contains an entry which can be:
The entries must be sorted in increasing order, according to the following conditions:
There should be an empty line after each test-case. Sample Input 1 3 1 377 11/01/1385 10:45:54.000 00:04:00.000 367 11/01/1385 10:45:54.000 00:03:00.000 357 11/01/1385 10:48:54.000 00:04:00.000 Sample Output Report for Test-Case #1: 367 11/01/1385 10:45:54.000 ACCEPTED 377 11/01/1385 10:45:54.000 POSTPONED 367 11/01/1385 10:48:54.000 LANDED 357 11/01/1385 10:48:54.000 ACCEPTED 357 11/01/1385 10:52:54.000 LANDED 377 11/01/1385 10:55:54.000 ACCEPTED 377 11/01/1385 10:59:54.000 LANDED Hint There may be situations in which handling of leap years is required. According to the Persian (Jalali) Calendar, leap year is a year which has 366 days instead of 365, and this extra day is added to the end of Esfand. You may assume that a given year is leap year if the remainder of it divided by 33 is either 1, 5, 9, 13, 17, 22, or 30. Actually, this formula is only correct if the given year is in the range [1178, 1634) but regardless of the given year in the input, use it for detection of leap years. NOTE:It seems that there are 12 months in a Persian (Jalali) year. The first 6 month have 31 days. The following 5 months have 30 day. The last year has 29 or 30 days according whether or not it is leap year. Source |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator