@@ -0,0 +1,2264 @@
+package virus;%0Aimport java.io.BufferedWriter;%0Aimport java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0Aimport java.io.OutputStreamWriter;%0A%0Apublic class Main %7B%0A    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));%0A    public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));%0A    public static int n , m;%0A    public static int map%5B%5D%5B%5D;%0A    public static int dx%5B%5D = %7B0,1,-1,0%7D;%0A    public static int dy%5B%5D = %7B1,0,0,-1%7D;%0A%0A    public static void main(String args%5B%5D) throws Exception %7B%0A        int zeros = getInput();%0A        test();%0A        for(int i =0; i%3Cn; i++)%0A            for(int j =0; j%3Cm; j++) %7B%0A                if(map%5Bi%5D%5Bj%5D==2) %7B%0A                    flood(i,j);%0A                    System.out.println(i+%22 %22+j);%0A                %7D%0A            %7D%0A        out.write(zeros + %22%5Cn%5Cn%22);%0A        test();%0A        in.close();%0A        out.close();%0A    %7D%0A%0A    public static int getInput() throws Exception%7B%0A        int cnt = 0;%0A        String%5B%5Dline = in.readLine().split(%22 %22);%0A        n = Integer.parseInt(line%5B0%5D);%0A        m = Integer.parseInt(line%5B1%5D);%0A        map = new int %5Bn%5D%5Bm%5D;%0A        for(int i =0; i%3Cn; i++) %7B%0A            line = in.readLine().split(%22 %22);%0A            for(int j =0; j%3Cm; j++) %7B%0A                map%5Bi%5D%5Bj%5D = Integer.parseInt(line%5Bj%5D);%0A                if(map%5Bi%5D%5Bj%5D==0)cnt ++;%0A            %7D%0A        %7D%0A        return cnt;%0A    %7D%0A%0A    public static void test()throws Exception %7B%0A        for(int i =0; i%3Cn; i++) %7B%0A            for(int j =0; j%3Cm; j++) %7B%0A                out.write(map%5Bi%5D%5Bj%5D+%22 %22);%0A            %7Dout.write(%22%5Cn%22);%0A        %7D%0A    %7D%0A%0A%0A    public static void flood(int x, int y) %7B%0A        int tx = x;%0A        int ty = y;%0A        for(int i =0; i%3C 4; i++) %7B%0A            tx = x+dx%5Bi%5D;%0A            ty =y+dy%5Bi%5D;%0A            if (isInRange(tx,ty)&&map%5Btx%5D%5Bty%5D==0) %7B%0A                map%5Btx%5D%5Bty%5D=3;%0A                flood(tx,ty);%0A            %7D%0A        %7D%0A        return ;%0A    %7D%0A    public void buildWall(int step,int x, int y)%7B%0A        if(step ==3)%7B%0A            for(int i =x; i%3Cn; i++) %7B%0A                for(int j=y; j%3Cm; j++) %7B%0A%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A    public static boolean isInRange(int x , int y) %7B%0A        return x%3E=0 && y %3E= 0 && x%3Cn && y%3Cm;%0A    %7D%0A%7D%0A%0A

solve virus not yet