This problem is non-standard
During the Han dynasty, astronomers meticulously recorded the coordinates of celestial bodies to predict the future and regulate calendar events important for agriculture and society. These data were passed from the central astronomy administration to the provinces to synchronize events and give accurate instructions for agricultural cycles and religious ceremonies. The problem is that data records at that time were kept on bamboo tablets, and the collected data could take up quite a lot of space. How to transport them… Your task is to archive the information collected by astronomers as efficiently as possible.
Keep in mind that:
Example: The Moon was observed in the 14th lunar mansion in the year defined by the 6th Heavenly Stem and 12th Earthly Branch, in May on the 23rd date.
Record: K011406120523
Therefore, in this task, for each test your solution will run twice:
In other words, you should implement encryption and decryption in one solution.
In this task, the length of the binary string output by your program should not exceed 2121212 characters.
In this problem records are generated equitably at random.
The binary string that was output in the first run is shown for illustrative purposes only and may not have anything in common with the real solution.
1 7 K112404110313 K120904070423 K260702060324 K360701040830 K422106090721 K712404040804 K932201121106 2 1010101010101010101010101010
1010101010101010101010101010 7 K112404110313 K120904070423 K260702060324 K360701040830 K422106090721 K712404040804 K932201121106