using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ //int Inf =(int) 1e9; int[][] m = new int[N][]; for(int i=0;i> k) % 2 == 0 && m[j][k] != -1){ dp[k][i | (1 << k)] = Math.Max(dp[k][i | (1 << k)], dp[j][i] + m[j][k]); } } } } Console.WriteLine(dp.Select(ar => ar.Max()).Max()); } int N,M; int[] A,B,C; public Sol(){ var d = ria(); N = d[0]; M = d[1]; A = new int[M]; B = new int[M]; C = new int[M]; for(int i=0;iint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }