Pergunta de entrevista da empresa Bloomberg

An interesting problem involving roman numerals.