There are N islands. There can be a maximum of two bridges(both bidirectional) connecting a pair of islands. Every bridge has a maintenance cost. You have to reduce the cost of maintenance as much as possible by breaking some of these bridges because a broken bridge does not need any maintenance. The bridges should be broken in such a way that any pair of islands should be reachable from each other. What is the maximum cost which can be reduced?
You are given the maintenance cost of each bridge in the form of 2D array. Arr. Arr[i][j] is the maintenance cost of one of the bridges between ith and jth islands.
Note
Input format
Output format
Constraints
1≤N≤103
1≤ Maintenance cost of each bridge ≤103
There are two bridges between island 1 and 2 of maintenance cost 3,10. So, the bridge with cost 10 can be broken. So maintenance cost of 10 can be reduced.