using System; using System.Collections; using System.Collections.Generic; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ used=new bool[H,W]; int cnt=-1; Buf=new List[2]; Buf[0]=new List(); Buf[1]=new List(); for(int i=0;i[] Buf; bool[,] used; int[] dx=new int[]{0,1,0,-1}; int[] dy=new int[]{1,0,-1,0}; void dfs(int y,int x,int c){ //Console.WriteLine(x+" "+y+" "+c); used[y,x]=true; Buf[c].Add(enc(x,y)); for(int i=0;i<4;i++){ if(y+dy[i]>=0 && y+dy[i]=0 && x+dx[i]int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }