$d=<>/2+.5;$b+=$_,$a-=$_*--$d,$u+=$d**2for@a=glob<>;$b=$b/@a+($a/=$u)*$d;$\+=($a*$i+++$b-$_)**2for@a;print"$b $a "