Mr Chaneks city represent plane he want build housing complex citythere telephone pole plane represent grid size n 1 time m 1 there telephone pole x y a_x y 1for point x y define Sx y square Euclidean distance near pole x y Formally square euclidean distance point x_1 y_1 x_2 y_2 x_2 x_12 y_2 y_12To optimize building plan project supervisor ask sum Sx y 0 leq x leq n 0 leq y leq m help find value sum_x0n sum_y0 m Sx y