@b=-<>;$_++for@c[glob<>];$a=$m=2e5+1;$b[$a]=$b[$a+1]+$c[$a],map$z-=$a*$c[$a]*$b[$_*$a],0..$m/$a+1while--$a;print$z