#K1396. Excel Column Title
Excel Column Title
Excel Column Title
Given a positive integer \(n\), convert it to its corresponding Excel column title. The mapping follows the pattern: \(1 \to A,\ 2 \to B,\ldots,\ 26 \to Z,\ 27 \to AA,\) and so on. Use the formula:
\[ \text{if } n > 0:\quad n \mathrel{-}= 1,\quad \text{remainder} = n \bmod 26,\quad \text{letter} = \text{chr}(\text{remainder} + 65),\quad n = \lfloor n/26 \rfloor \]
and output the resulting string after reversing the accumulated characters.
inputFormat
Input is provided from standard input (stdin) as a single line containing a positive integer (n).
outputFormat
Output to standard output (stdout) a string representing the corresponding Excel column title.## sample
1
A