Time Limit: Java: 2000 ms / Others: 2000 ms
Memory Limit: Java: 65536 KB / Others: 65536 KB
Every year that is a multiple of 4 is a leap year, i.e. has an extra day (February 29).
In 1582, Pope Gregory's astronomers noticed that the year was not 365.25 days long, but closer to 365.2425. Therefore, the leap year rule would be revised to the following:
Every year that is a multiple of 4 is a leap year, unless it is a multiple of 100 that is not a multiple of 400.
To compensate for how the seasons had shifted against the calendar up until that time, the calendar was actually shifted 10 days: the day following October 4, 1582 was declared to be October 15.
England and its empire (including the United States) didn't switch to the Gregorian calendar system until 1752, when the day following September 2 was declared to be September 14. (The delay was caused by the poor relationship between Henry VIII and the Pope.)
Write a program that converts dates in the United States using a calendar of the time and outputs weekdays.
November 15, 1997 is a Saturday January 1, 2000 is a Saturday July 4, 1998 is a Saturday February 11, 1732 is a Friday September 2, 1752 is a Wednesday September 14, 1752 is a Thursday 4/33/1997 is an invalid date.