fork(1) download
  1. #!perl -p
  2. %x=(I,1,IV,4,V,5,IX,9,X,10);$a="(X{0,3}(?:V?I{1,3}|I?V|IX)|X{1,3})"x3;m*^$a,$a,$a$(?{@z=map"$$_",0..9;$r|=!grep$x-$_,map{$x=eval s/./ $z[$&]/gr=~s/IX|IV|\S/+$x{$&}/gr}123,456,789,147,258,369,159,357;++$-})^*;$_="$-,$r"
  3.  
Success #stdin #stdout 0s 6000KB
stdin
VIIIIVI,IIIVVII,IVIXII
stdout
24,1