#K71677. Integer to Roman Numeral Conversion
Integer to Roman Numeral Conversion
Integer to Roman Numeral Conversion
Given an integer n where 1 ≤ n ≤ 3999, convert it to its Roman numeral representation. The Roman numeral system uses the following symbols:
- I for 1
- V for 5
- X for 10
- L for 50
- C for 100
- D for 500
- M for 1000
Some examples include: 3 → III
, 4 → IV
, 9 → IX
, 58 → LVIII
, and 1994 → MCMXCIV
.
You may refer to the conversion process as follows in LaTeX: $$ n = \sum_{i=1}^{k}a_i \quad \text{where each }a_i\text{ is one of the values }1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000. $$
inputFormat
The input consists of a single line containing an integer n (1 ≤ n ≤ 3999).
outputFormat
Output the Roman numeral representation corresponding to the given integer.
## sample3
III