Problem:
Problem H:
Sightseeing Tour KM city has $N$ sightseeing areas. Currently every pair of area is connected by a bidirectional road. However for some reason, Mr. KM, the mayor of this city, decided to make all of these roads one-way . It costs $C_{i, j}$ dollars to renovate the road between area $i$ and area $j$ to a one-way road from area $i$ to area $j$. Of course, Mr. KM is economic and wants to minimize the total cost of the renovation. On the other hand, because tourism is the most important industry for KM city, there must exists a tour that goes through all the sightseeing areas, visiting each area exactly once. The first and last area of the path need not to be the same. Can you calculate the minimum total cost required for the renovation, given this situation? Input The first line contains the number of sightseeing area $N$ ($1 \leq N \leq 100$). Next $N$ lines describe the integer matrix $C$, where the $j$-th element of the $i$-th row of the input describes $C_{i,j}$ ($0 \leq C_{i,j} \leq 1,000,000$). For each $i$, you can assume $C_{i,i}$ is always zero. Output Output the minimum cost in a line. Sample Input 1 3
0 2 7
2 0 4
5 8 0 Sample Output 1 11

Solution (Python):
N = int(raw_input())
C = [map(int,raw_input().split()) for i in xrange(N)]
ans = 0
for i in xrange(N):
    for j in xrange(i+1,N):
        ans += min(C[i][j], C[j][i])
print ans

Solution (Python):
N = int(raw_input())
cost = [map(int,raw_input().split(" ")) for _ in range(N)]
all_cost = 0
for i in range(N):
	for j in range(i):
		all_cost += cost[i][j] if cost[i][j] <= cost[j][i] else cost[j][i]
print all_cost

Solution (Python):
import sys

def main():
    n = int(input())
    edges = []
    for i in range(n):
        edges.append( list(map(int, sys.stdin.readline().split())) )
    
    
    
    

    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += min(edges[i][j], edges[j][i])

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    while True:
        n = I()
        a = [LI() for _ in range(n)]
        r = 0
        for i in range(n):
            for j in range(i+1,n):
                r += min(a[i][j], a[j][i])

        rr.append(r)
        break

    return '\n'.join(map(str, rr))


print(main())

Solution (Python):
N=input()
C=[map(int,raw_input().split()) for i in range(N)]
s=0
for i in range(N):
    for j in range(i):
        s+=min(C[i][j],C[j][i])
print s

Solution (Python):
n = int(input())
graph = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
  graph[i] = list(map(int, input().split()))
ans = 0
for i in range(n):
  for j in range(i+1, n):
    ans += min(graph[i][j], graph[j][i])
print(ans)