Grid MST
This is a very simple problem. You are given N points. Some points may be repeated. The weight (distance) between two points is given by the Manhattan distance between the two points. Find the weight of a Minimum Spanning Tree that spans these N points.
Input
The input consists of:
-
One line with one integer N