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