The British
Informatics Olympiad is the computing competition for schools and colleges. We are proud to present BIO 2004, sponsored by Lionhead Studios. |
Question 1 Mayan Calendar |
The Mayan civilisation used three different calendars. In their long count calendar there were 20 days (called kins) in a uinal, 18 uinals in a tun, 20 tuns in a katun and 20 katuns in a baktun. In our calendar, we specify a date by giving the day, then month, and finally the year. The Maya specified dates in reverse, giving the baktun (1-20), then katun (1-20), then tun (1-20), then uinal (1-18) and finally the kin (1-20). The Mayan date 13 20 7 16 3 corresponds to the date 1 January 2000 (which was a Saturday). |
||
1 (a) [24 marks] |
Write a program which, given a Mayan date (between 13 20 7 16 3 and 14 1 15 12 3 inclusive), outputs the corresponding date in our calendar. You should output the month as a number. You are reminded that, in our calendar, the number of days in each month is: |
Sample run 13 20 9 2 9 22 3 2001 |
1 | January | 31 |
2 | February | 28 / 29 (leap year) |
3 | March | 31 |
4 | April | 30 |
5 | May | 31 |
6 | June | 30 |
7 | July | 31 |
8 | August | 31 |
9 | September | 30 |
10 | October | 31 |
11 | November | 30 |
12 | December | 31 |
Within the range of dates for this question, every year divisible by 4 is a leap year. | |
1 (b) [2 marks] |
What are the Mayan dates for 1 February 2000 and 1 January 2001? |
1 (c) [3 marks] |
The Maya believed the universe was destroyed and re-created every cycle of their calendar, which was 20 baktun in length. How many kins (days) are there in a cycle? What day of the week is the last day of the current cycle (20 20 20 18 20)? |
A worked solution to the problem is in preparation.