Home  | Welcome  | Problems  | Winter '99 #3 ]

Problem  | Test Cases  | Results  | Solutions  | Discussion ]

Winter '99 #3 - Agri-Net

[Russ Cox]

Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.

Farmer John ordered a high speed connection for his farm and is going to share his connectivity with the other farmers. To minimize cost, he wants to lay the minimum amount of optical fiber to connect his farm to all the other farms.

Given a list of how much fiber it takes to connect each pair of farms, you must find the minimum amount of fiber needed to connect them all together. Each farm must connected to some other farm such that a path exists from any farm to any other farm.

INPUT FORMAT:
The first line of input is the number of farms, N (3 <= N <= 100). Each line i of N subsequent lines contains N non-negative integers (each less than 32000) that represent the distance between farm i and farms 1, 2, 3, ..., N. Of course, the diagonal will be 0, since the distance from farm i to itself is not interesting for this problem.

SAMPLE INPUT (file INPUT.TXT):

4
0 4 9 21
4 0 8 17
9 8 0 16
21 17 16 0

OUTPUT FORMAT:
The single output contains the integer length that is the sum of the minimum length of fiber required to connect the entire set of farms.

SAMPLE OUTPUT (file OUTPUT.TXT):
28


Test Cases

Coming upon availability.


Results

Coming upon availability.


Solutions

Coming upon availability.


Discussion

Coming Soon. Very Soon.

Problem  | Test Cases  | Results  | Solutions  | Discussion ]

Updated February 3, 1999 Frames On John Danaher
<jdanaher@tjhsst.edu>