($n,$k)=glob<>; $h{int$k}=1; for$i(reverse 1..$n){ %d=%h; for(keys%h){ $a=int$_/$i; $d{$a}+=$h{$_} if$a; } %h=%d; } $t=0; for(keys%h){ $t+=$d{$_}; } print $t-1;