|
|||||||||||||||||||
|
SPOJ time: 2012-05-26 13:53:15 |
Suan PanProblem code: HS08SUAN
![]() Johnny's fabulous birthday party turned out more costly than he had expected. So, once again, he ran to Leo's shop, this time asking for a holiday job. Leo agreed to hire Johnny, but he expects that Johnny learns to operate the abacus which Leo uses for totting up bills - as soon as possible! ![]() Leo's first task for Johnny was as follows. The old man said: "Here is a Chinese abacus which you can use for calculations both in the decimal system, and in the hexadecimal system. Successive digits in the hexadecimal system are represented by successive columns of the abacus, starting from the right. In each of the upper rows one bead has a value of 5, in each of the lower rows - a value of 1. Your task is to represent a decimal number, given on a sheet of paper, in the form of a hexadecimal number on the abacus. You must do all the necessary arithmetic yourself, assisted only the abacus, if you wish." Help Johnny find a solution to his problem! InputEvery data set consists of one positive integer D given in the decimal system with at most 30 digits. OutputWrite to output the correct state of the Chinese abacus, representing the value of D in the hexadecimal system. Assume that the number of columns of the abacus is equal to 30. Example 1
Input:
251
Output:
------------------------------
oooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
oo
------------------------------
oo
ooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooo o
------------------------------
Example 2
Input:
28724239499488423
Output:
------------------------------
ooooooooooooooooooo o o o o
oooooooooooooooo oo ooooo oo
oo ooo ooooooo
------------------------------
oo ooooooooo o
oooooooooooooooo ooo o oo ooo
ooooooooooooooooooo oo o oo o
oooooooooooooooooooo ooooooooo
oooooooooooooooooooooooooooooo
ooooooooooooooooooooooooo oooo
------------------------------
ScoringFor every test data you can get 1, 2 or 3 points, summing to a total of 10 points.
|
||||||||||||||||||
| |||||||||||||||||||