发布时间: 2016年12月3日 16:34 最后更新: 2016年12月3日 16:34 时间限制: 1000ms 内存限制: 65536M
The first line of input contains an integer N which is the number of datasets that follow (1 <= N <= 1000). Each dataset consists of a single line containing two dates: the transaction date and the document date; there is a single space between them. The transaction date is of the form M/D/Y where M is the month number (1 <= M <= 12), D is the day of month (1 <= D <= md1) and Y is the year (2000 <= Y <= 2200). The document date is of the form m/d where m is the month number (1 <= m <= 12) and d is the day of month (1 <= d <= md2). The values of md1 and md2 will not exceed the number of days in the respective months M and m.
For each dataset print out the dataset number followed by a space followed by the result of the date comparison as shown in the table below:
Notes: When printing the result date, m/d/y, you will have to determine the year value y (1999 <= y <= 2201). This is not necessarily the same as the transaction date’s year value Y. Since the Kalii taxation fiasco a couple of years back, the Kaliian government decided to switch to the standard Gregorian calendar. As such, Gregorian leap year rules apply. A year is a leap year (February has 29 days instead of 28) if the year if evenly divisible by 4, except for century years (those ending in 00), which are leap years only if they are evenly divisible by 400. 2000 and 2004 are leap years, but 2100 and 2101 are not. For those who do not know, the months of January, March, May, July, August, October and December all have 31 days in them. February has 28 days (unless in a leap year, then it has 29). The remainder of the months has 30 days.
7 11/20/2005 11/21 11/20/2005 11/17 11/20/2005 11/20 11/20/2005 11/13 11/20/2005 11/28 1/2/2005 12/30 12/31/2100 1/3
1 11/21/2005 IS 1 DAY AFTER 2 11/17/2005 IS 3 DAYS PRIOR 3 SAME DAY 4 11/13/2005 IS 7 DAYS PRIOR 5 OUT OF RANGE 6 12/30/2004 IS 3 DAYS PRIOR 7 1/3/2101 IS 3 DAYS AFTER