ZOJ Problem Set - 1386
The Classical Maya civilization developed in what is today southern Mexico,
Guatemala, Belize and northern Honduras. During its height they developed a
sophisticated system for time keeping which they used both to record history
and for divinatory rituals. Their calendar consisted of 3 components: the Tzolkin,
the Haab and the Long Count.
Imix, Ik, Akbal, Kan, Chikchan, Kimi, Manik, Lamat, Muluk, Ok, Chuen, Eb, Ben, Ix, Men, Kib, Kaban, Etznab, Kawak, Ajaw
The sequence of days developed as follows (starting for example at 9 Imix): 9 Imix, 10 Ik, 11 Akbal, 12 Kan, 13 Chikchan, 1 Kimi, 2 Manik, ...
The Haab calendar was an astronomical one. It had 365 days divided into 19 months each with 20 days, except the last one which had only 5 days. In a manner similar to the Tzolkin each month name had a number from 1 to 20 indicating the day number within the month. Again, from Spanish colonial sources, we know the names of the months:
Pohp, Wo, Sip, Zotz, Sek, Xul, Yaxkin, Mol, Chen, Yax, Sak, Keh, Mak, Kankin, Muan, Pax, Kayab, Kumku, Wayeb
The month Wayeb had just 5 days and was considered an unlucky time of the year.
The Tzolkin and Haab were combined in the inscriptions to create the Calendar Round, combining the 260 day cycle of the Tzolkin and the 365 day cycle of the Haab. A typical Calendar Round date in the inscriptions might be: 3 Lamat 6 Pax. Note that not all of the combination of days, months and coefficients are possible.
A typical sequence of days in the Calendar Round (starting for example at 3 Lamat 6 Pax):
3 Lamat 6 Pax, 4 Muluk 7 Pax, 5 Ok 8 Pax, 6 Chuen 9 Pax, 7 Eb 10 Pax, 8 Ben
11 Pax, 9 Ix 12 Pax, 10 Men 13 Pax, 11 Kib 14 Pax, 12 Kaban 15 Pax, 13 Etznab
16 Pax, 1 Kawak 17 Pax, 2 Ajaw 18 Pax, 3 Imix 19 Pax, 4 Ik 20 Pax, 5 Akbal 1
Kayab, 6 Kan 2 Kayab, ...
Note that for every Long Count date b.k.t.w.i we have 0 <= k < 20; 0 <= t < 20; 0 <= w < 18; 0 <= i < 20.
Given the periodicity of the Calendar Round, a legal date such as 3 Lamat
6 Pax has multiple occurrences in the Long Count. Thus, one difficulty in reading
inscriptions is in establishing a date for the inscription when the date is
given only in terms of a Calendar Round (very common). In this case one must
compute "all" the possible Long Count dates associated with the particular
Calendar Round and based in some other context information deduce (for example,
the text mentions a king for which other dates are known) which one applies.
For every data set your program must output an ascending sequence of Long
Count dates computed for a given Calendar Round date.
Source: Central Europe 2001