Your task is to choose k locations to put signs . Let c(i,j) be the distance from the i-th station to the closest sign between station i and station j. c(i,j) = |xi - xj| if there's no sign between them. Find the optimal solution of the sign locations to minimize
There are n stations on the road, which are located at x1 ... xn (x1 < x2 < ... < xn). Your task is to choose k locations to put signs (signs could be put at anywhere, not necessary to be at a station). Let c(i,j) be the distance from the i-th station to the closest sign between station i and station j. c(i,j) = |xi - xj| if there's no sign between them. Find the optimal solution of the sign locations to minimize sum_{i neq j} c(i,j) ∑ i =j c(i,j).
(图片来源网络,侵删)