#P8738. Tian Gan Di Zhi Year Calculator
Tian Gan Di Zhi Year Calculator
Tian Gan Di Zhi Year Calculator
In ancient China, years were recorded using the heavenly stems and earthly branches. There are 10 heavenly stems: \(\text{甲, 乙, 丙, 丁, 戊, 己, 庚, 辛, 壬, 癸}\), and 12 earthly branches: \(\text{子, 丑, 寅, 卯, 辰, 巳, 午, 未, 申, 酉, 戌, 亥}\). By combining one heavenly stem and one earthly branch, a year is identified (for example, 甲子). It is known that 2020 is the year of \(\text{庚子}\).
Every year, both the heavenly stem and the earthly branch move to the next in their sequence. Therefore, for a given Gregorian year \(Y\), if we let \(\Delta = Y - 2020\), then:
- The index for the heavenly stem is given by \( (6 + \Delta) \mod 10 \) because 2020 corresponds to index 6 (\(\text{庚}\)).
- The index for the earthly branch is given by \( (0 + \Delta) \mod 12 \) because 2020 corresponds to index 0 (\(\text{子}\)).
Output the concatenation of the corresponding heavenly stem and earthly branch.
inputFormat
The input consists of a single integer \(Y\) representing the Gregorian year.
outputFormat
Output the Chinese cyclic year name (a string of two Chinese characters representing the heavenly stem and earthly branch).
sample
2020
庚子