Given n 2D points, select k points such that the value of max(x1, x2, ..., xk) + max(y1, y2, ..., yk) is minimized. Here, (x1, y1), (x2, y2), ..., (xk, yk) are the coordinates of the selected k points.
The first line contains two positive integers n and k.
The next n lines each contain two integers, representing the x and y coordinates of the n 2D points.
Output the minimum value of max(x1, x2, ..., xk) + max(y1, y2, ..., yk).
Remember to print a ‘\n’ at the end of the output.
Select points (1, 6), (4, 8), and (5, 9) such that max(1, 4, 5) + max(6, 8, 9) = 14. This is the optimal selection.