Maximum Spanning Forest

HDU - 5537