A community farming cooperative keeps a century-spanning almanac of harvest events, but the surviving paper ledgers were never annotated with the day of the week each entry fell on. Given a Gregorian calendar date, determine which day of the week it fell on so the archive can be reconciled against known local market-day cycles.
A single line containing three space-separated integers day month year.
Print a single line containing the English name of the day of the week -- one of Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.
1971 <= year <= 21001 <= month <= 12day is a valid day of that month in that year under the standard Gregorian calendar (leap years are those divisible by 4, except century years not divisible by 400).Example 1
Input
15 6 2000
Expected
Thursday
Explanation
June 15, 2000 falls on a Thursday under the Gregorian calendar, so the program prints 'Thursday'.
Example 2
Input
29 2 2096
Expected
Wednesday
Explanation
2096 is divisible by 4 and not by 100, so it is a leap year and February has a 29th day that year. That date, February 29, 2096, falls on a Wednesday.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →