import java.util.Scanner; public class Main { static int N, M; static int list[][]; static boolean flag[]; static int ans = 0; public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { N = Integer.parseInt(scan.next()); M = Integer.parseInt(scan.next()); flag = new boolean[N]; list = new int[N][N]; for(int i=0; i 0) { int left = now.indexOf(""+i); int right = now.indexOf(""+j); if(left < right) { sum += list[i][j]; } } } } ans = Math.max(ans, sum); return; } for(int i=0; i