sum of distance to kings minimizing