Integer to Roman Numeral

Easy

Given an integer num, convert it to a roman numeral.

Roman numerals are denoted by a combination of some symbols.

ValueSymbol
1I
5V
10X
50L
100C
500D
1000M
Example 1

num: 10

Result: “X”

Example 2

s: 6

Result: “VI”

Example 3

s: 12

Result: “XII”

Read about Integer to Roman conversion here.

Testing

Input Format

The first line contains an integer ‘T’ denoting the number of test cases.

For each test case, the input contains a line with an integer ‘num’.

Output Format

For each test case, the output contains one line with a string ‘s’ denoting the roman denotation of num.

Sample Input

3
15
3610
20

Expected Output

XV
MMMDCX
XX

Constraints

1 <= T <= 100
1 <= num <= 4000

Editorial Link: Editorial