ZOJ Problem Set - 3403
As we know, in the Bzu planet and in the cc98 planet, people use special calendar which is similar to that used in the earth. In fact, in the BoMb planet, people use a similar calendar as well!
As a matter of fact, people who live in the BoMb planet are all from the earth after a big bomb blew up on the earth. Because of being used to the calendar in the earth, they use Day, Month and Year in the calendar in the BoMb too. But the operational cycle of the BoMb planet is so ridiculous that people have to make strange rules for their new calendar.
The rules are listed below:
Now given two dates in the format of BoMb calendar, you are to calculate how many days there are in total between the two days(include the two days).
The input contains multiple test cases. There are only two lines in each test case. The first line is a string "m1-d1-y1", indicating the d1th day in the m1th month of Year y1. The second line is a string "m2-d2-y2" indicating the date of the other day. You can assume the two dates are legal in BoMb calendar and are diffrent, and y1 and y2 are in the range of [0, 109].
For each test case, output a single line the number of days between the two days (include the two days) given in the input.
Author: LI, Dinghua
Contest: ZOJ Monthly, September 2010