$#a=2*pop;print 1/($N=pop)*grep{keys%{{map{int rand 10}@a}}>9}1..$N