($n,$k)=glob<>; ++$m while $m*$m<$n|$m*$k<$n; @a=('.'x$m.$/)x$m; vec($a[$_%$m],($_+$_/$m)%$m,8)=35 for 0..$n-1; print$m,$/,@a