@x=@_;my%c;$e=sub{my$v=pop;$c{$v}//=!$v||$v>0&&grep&$e($v-$_),@x};for($t=$s=0;$t-$s<$x[0];&$e(++$t)or$s=$t){}$s