Roman Numerals
In your new project, you need to work with Roman numerals and convert them into decimal numbers.
The Roman numeral system uses the following 7 symbols:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
Roman numerals are formed by combining these symbols. When a larger or equal symbol precedes a smaller one, their values are added. If a smaller symbol comes before a larger one, the smaller value is subtracted from the larger.
Input
The first line contains the integer N (1 ≤ N ≤ 100) — the number of Roman numerals to convert. The next N lines each contain a Roman numeral.
Output
Output N decimal numbers, each representing the conversion of the corresponding Roman numeral from the input. The decimal numbers should be in the same order as their respective Roman numerals. It is guaranteed that each converted number will be within the range [1, 1000].