($n,$s,$w,@a)=`dd`=~/\d+/g;$w=splice@a,$w,1;print-eval{map{$i++while$i<@a&($s*250/(4+@a-$i)|0)-$s*50<=$w-$_;$c+=log($i-$j)-log++$j}sort{$b-$a}@a;-exp$c}