perl -MList::Util="first" -E "@c[0..123456789]=(0..123456789);say for grep{$e=eval $_;$c[$e]=undef if $e >=0;$h{$e}++;eval $_ == 100} glob '{-,}'.join '{+,-,}',1..9;END{ say for (sort{ $h{$b}<=>$h{$a}}grep{$_>=0}keys %h)[0], first{defined $_}@c}" Out of memory! panic: gen_constant_list JMPENV_PUSH returned 2 at -e line 1.