Description

Roman numerals are represented by seven symbols: I (1), V (5), X (10), L (50), C (100), D (500), M (1000). Given an integer, convert it to a roman numeral.

Examples

Input:num = 3
Output:"III"
Explanation:

3 is represented as 3 ones.

Input:num = 58
Output:"LVIII"
Explanation:

L = 50, V = 5, III = 3.

Input:num = 1994
Output:"MCMXCIV"
Explanation:

M = 1000, CM = 900, XC = 90, IV = 4.

Constraints

  • 1 ≤ num ≤ 3999

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!