No.405 Roman Numeral Wristwatch
Problem Statement
There is a wristwatch whose dial is marked with Roman numerals.
Now, the hour hand points to the position of the Roman numeral S1,
and the minute hand points to the position of "XII".
Where will the hour hand be after T hours?
Output the Roman numeral S2 at the position of the hour hand after T hours.
The Roman numerals marked on the dial are, in order starting from 1 o'clock,
"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII".
Each Roman numeral is expressed by combining the uppercase letters "I","V","X".
Input
S1 T
S1 is a string of a Roman numeral (as listed in the problem statement), and T is an Arabic numeral.
$-1000 \le T \le 1000$
Output
Output S2. S2 is a string of a Roman numeral.
Print a newline at the end.
Sample
Sample 1
Input
XII 4
Output
IIII
It is 4 hours after 0 o'clock, so the hour hand points to "IIII".
Note that this Roman numeral for "4" is specific to clocks.
Sample 2
Input
VI 12
Output
VI
It is 12 hours after 6 o'clock, so the hour hand returns to its original position and points to "VI".
Sample 3
Input
I -26
Output
XI
It is -26 hours after 1 o'clock, that is, 26 hours before, so the hour hand points to "XI".
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
No
btk