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 max = 0; max = Math.Max(max, chk1(0,0,0)); max = Math.Max(max, chk1(0,1,0)); max = Math.Max(max, chk1(0,0,1)); max = Math.Max(max, chk1(1,0,1)); max = Math.Max(max, chk1(0,N-1,1)); max = Math.Max(max, chk1(1,N-1,1)); max = Math.Max(max, chk1(N-1,0,0)); max = Math.Max(max, chk1(N-1,1,0)); max = Math.Max(max, chk2(0)); max = Math.Max(max, chk2(1)); max = Math.Max(max, chkrot(0)); max = Math.Max(max, chkrot(1)); Console.WriteLine(max); } int chk1(int r, int c, int dir){ int cnt = 0; switch(dir){ case 0: { // horizontal bool chk = true; for(int j=c;jint.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));} }