Calendar Contest Problem 3 Classical Maya Solution

Classical Maya Solution

You thought this contest was just academic exercise, but it appears that the Gaelic curse placed upon you during the World Tour Contest was not broken, and took effect once again. (Or perhaps you didn’t manage to break it, in which case you deserve what’s coming next.)

You find yourself in some ancient time in the jungles on the Yucatán penisula, and you meet a bunch of people you believe are Maya. Unfortunately, you do not understand a word of what they are saying to you. Fortunately, body language exists. And so you point at the sky, then at the sun, and make circlar motions. They seem to understand that you wish to know the date, and so they draw some lines in the sand, giving you nn integers. It is now up to you to figure out the date, which you hope would bring you one step back to civilization and the modern era.

Input Specification

The first line will contain the integer N (0≤N≤1000)N (0≤N≤1000), the number of lines that follows.

Each subsequent line will contain n (5≤n≤13)n (5≤n≤13) non-negative integers separated by spaces. Every integer will be in the range [0,20)[0,20) except for the second last, which will be in the range [0,18)[0,18).

Output Specification

For each input line, output the date represented by the five integers in ISO 8601 format using the Gregorian calendar on its own line. If the year contains less than 4 digits, it should be zero-padded until it has 4 digits.

Sample Input

7 16 6 16 18
12 19 19 17 19

Sample Output


Note: Please click one of our ads once we reach 20 click’s will release the solution’s. It help’s us to generate revenue and run this site

Calendar Contest Problem

  1. Sexagenary Cycle Solution
  2. Day of the Week Solution
  3. Classical Maya Solution
  4. Savvyday 29 Oatmeal 94
  5. Reign of Terror Solution
  6. Ming Dynasty Solution

Leave a Comment