Files
PAT/html/a1100.html
T

33 lines
1.3 KiB
HTML

<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h1>1100. Mars Numbers (20)</h1>
<div id="problemContent">
<p>People on Mars count their numbers with base 13:</p>
<ul>
<li> Zero on Earth is called "tret" on Mars.
<li> The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively.
<li> For the next higher digit, Mars people name the 12 numbers as "tam, hel, maa, huh, tou, kes, hei, elo, syy, lok, mer, jou", respectively.
</li></li></li></ul>
<p>For examples, the number 29 on Earth is called "hel mar" on Mars; and "elo nov" on Mars corresponds to 115 on Earth. In order to help communication between people from these two planets, you are supposed to write a program for mutual translation between Earth and Mars number systems. </p>
<p><b>
Input Specification:
</b></p>
<p>Each input file contains one test case. For each case, the first line contains a positive integer N (&lt; 100). Then N lines follow, each contains a number in [0, 169), given either in the form of an Earth number, or that of Mars.</p>
<p><b>
Output Specification:
</b></p>
<p>For each number, print in a line the corresponding number in the other language.</p>
<b>Sample Input:</b><pre>
4
29
5
elo nov
tam
</pre>
<b>Sample Output:</b><pre>
hel mar
may
115
13
</pre>
</div>