Integer to Roman — greedy subtraction
Roman numerals are written largest to smallest. Repeatedly take the biggest value that still fits — including the subtractive pairs like CM (900) and XL (40) — until nothing remains.
Try:
remaining: 0