$@=29628;s/./y$ IIVCXL426 (-:V$XIVX
LMCDIVX$dfor$$_ .=5x$&*8% $@;$$$_=$
_/egfor-4e3..0; $;=qq/LXX IV+CXVII+
CXV +CX VI+
XXX II+ XCV
II+ CX+ CXI
+CX VI+ CIV
+CI +CX IV+
XXX II+ LXX
X+C I+C XIV
+CV III +XX
XII +CI V+X
CVI I+X CIX
+CV II+ CI+
CXI V+X LIV
+X+ XLV III
C+C MII XV+
DXI M+I MCC
MCM +XXIII
DCI MMV+II
C+I MMVIII
/;$;=~s/\s+//g; print+
eval(join+q/./, map-${
$_},+split/\+/, ~~$;);
Inspired by
Erudil's,
There can be only one!,
My 2 cents worth, my own
The Power of Three, and (of course)
thospel's
original magic formula.
For those of you who prefer signatures and want (at least a little) more insight into what's going on:
s/./y$IVCXL426(-:$XLMCDIVX$dfor$$_.=5x$&*8%29628;$$$_=$_/egfor-4e3..0;
print+eval(join+qq/./,+map-${$_},split/\+|\n/,+qq/LXXIV+CXVII+CXV+CXVI
XXXII+XCVII+CX+CXI+CXVI+CIV+CI+CXIV+XXXII+LXXX+CI+CXIV+CVIII+XXXII+CIV
XCVII+XCIX+CVII+CI+CXIV+XLIV+X/)