No.2775 Nuisance Balls
タグ : / 解いたユーザー数 176
作問者 :
amentorimaru
Story
Yu-san is now able to get proper sleep, so she has decided to tidy up the nuisance balls that, for some reason, are in her room in large numbers.
However, even though Yu-san intends to clean up, she does not seem to be very motivated.
Yu-san said, "If only I could represent the number of balls in the style of a certain falling-block puzzle game..."
Let's make this happen and motivate Yu-san.
Problem Statement
Yu-san has $N$ balls.
However, she wants to make the number of balls easier to understand visually, so she has decided to represent the count using symbols.
The correspondence between symbols and counts is as follows.
.represents $1$ ball.o(lowercase letter "o") represents $6$ balls.Rrepresents $30$ balls.Srepresents $180$ balls.Mrepresents $360$ balls.Crepresents $720$ balls.
Among the strings formed by arranging these symbols, each usable multiple times, consider those for which the sum of the numbers of balls represented by the symbols equals $N$. Take the one with the minimum length, sort it in descending order of the number of balls each symbol represents, and output it.
Under these conditions, for any $N$, exactly $1$ string of symbols is the correct answer.Input
$N$
Constraints
- $1\leq N \leq 4320$
- $N$ is an integer
Output
Print a newline at the end.
Sample
Sample 1
Input
10
Output
o....
o represents $6$ balls and . represents $1$ ball, so this string represents $10$ balls.
No string shorter than this one represents $10$ balls, and the symbols are arranged in descending order of the number of balls they represent, so this sample output is valid.
For this input, printing ....o is not valid, because a symbol representing $1$ ball is to the left of a symbol representing $6$ balls.
Sample 2
Input
1
Output
.
This is the only string that represents $1$ ball.
Sample 3
Input
1297
Output
CMSRo.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。