eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Network Saboteur

Network Saboteur

A university network is composed of \textbf{N} computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order to minimize traffic between parts. A disgruntled computer science student Vasya, after being expelled from the university, decided to have his revenge. He hacked into the university network and decided to reassign computers to \textit{maximize} the traffic between two subnetworks. Unfortunately, he found that calculating such worst subdivision is one of those problems he, being a student, failed to solve. So he asks you, a more successful CS student, to help him. \includegraphics{https://static.e-olymp.com/content/14/144d47426e5537d7093f5c2a167bafd00ec2fd67.jpg} The traffic data are given in the form of matrix \textbf{C}, where \textbf{C_ij} is the amount of data sent between ith and jth nodes (\textbf{C_\{ij \}= C_ji}, \textbf{C_\{ii \}= 0}). The goal is to divide the network nodes into the two disjointed subsets \textbf{A} and \textbf{B} so as to maximize the sum . \InputFile The first line of input file contains a number of nodes \textbf{N} (\textbf{2} ≤ \textbf{N} ≤ \textbf{20}). The following \textbf{N} lines, containing \textbf{N} space-separated integers each, represent the traffic matrix \textbf{C} (\textbf{0} ≤ \textbf{C_ij} ≤ \textbf{10000}). \OutputFile Output file must contain a single integer --- the maximum traffic between the subnetworks.
Лимит времени 4 секунды
Лимит использования памяти 64 MiB
Входные данные #1
3
0 50 30
50 0 40
30 40 0
Выходные данные #1
90
Источник ACM ICPC 2002/2003 Quarterfinal (Far-Eastern Subregion) Vladivostok, November 2, 2002.