CF277E Binary Tree on Plane
Description
A root tree is a directed acyclic graph that contains one node (root), from which there is exactly one path to any other node.
A root tree is binary if each node has at most two outgoing arcs.
When a binary tree is painted on the plane, all arcs should be directed from top to bottom. That is, each arc going from $ u $ to $ v $ must meet the condition $ y_{u}>y_{v} $ .
You've been given the coordinates of all tree nodes. Your task is to connect these nodes by arcs so as to get the binary root tree and make the total length of the arcs minimum. All arcs of the built tree must be directed from top to bottom.
Input Format
N/A
Output Format
N/A