#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; #define INF 100000000 int N; int cost[30][30]; map dp; int solve(ll S){ if(S == 0) return 0; if(dp.count(S) > 0) return dp[S]; int ret = 0; rep(i,N){ REP(j,i+1,N){ if(((S>>i)&1) && ((S>>j)&1)){ ret = max(ret, cost[i][j] + solve(S - (1<> N; rep(i,N){ rep(j,N){ cin >> cost[i][j]; if(i==j) cost[i][j] = -INF; } } cout << solve((1LL<