#CCBCMCHIN0000062. Ngày kế tiếp (Next Calendar Date)
Ngày kế tiếp (Next Calendar Date)
Next Calendar Date
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a valid Gregorian date, output the next date as day, month, year. The input year is at most 9998, so the next date stays in the supported year range.
Input
One line contains three integers d,m,y in that order.
Output
Print the resulting day, month and year separated by spaces.
Subtasks
-
Subtask 1 (20 points): A non-end-of-month valid date; 1 <= y <= 9998.
-
Subtask 2 (30 points): A valid date in months {1,3,4,5,6,7,8,9,10,11}.
-
Subtask 3 (50 points): Any valid date; 1 <= y <= 9998.
Examples
Example 1
Input
28 2 1900
Output
1 3 1900
Explanation
For this input, the case-specific computation and the required exact output are shown above. 1900 is not leap; February 28 is followed by March 1.
Example 2
Input
29 2 2000
Output
1 3 2000
Explanation
For this input, the case-specific computation and the required exact output are shown above. 2000 is leap; February 29 is followed by March 1.