Welcome to CSEmpur once again!
It has been observed that a good number of inhabitants like palindromic numbers. As all of them know, a palindromic number is a number (in some base b) that is the same when written forwards or backwards, i.e., of the form a1 a2 ... a2 a1.
The number system they use is the 10-based number system, with symbols '0', '1', ..., '8', '9', as usual.
Good queen Alysanne of House Targaryen wants to give her loyal subjects a program. One may tell the program a number, n. The program will produce the nth palindromic number written in CSEmpur number system.
Obviously, the queen tells you, the grandmaester, to solve the problem. From your training in the Citadel, you know the first palindromic number is '0', the second is '1', and you can build up on that.
The input will consist of a single positive number, n, the number the program gets as an input. The number will be less than 536870910.
It is your job to print the nth palindromic number in CSEmpuric number system.
Input | Output |
---|---|
536006334 | 43600633433600634 |
Input | Output |
---|---|
7 | 6 |
Input | Output |
---|---|
20 | 101 |
Input | Output |
---|---|
21 | 111 |
Input | Output |
---|---|
112 | 1221 |
Input | Output |
---|---|
113 | 1331 |