import java.io.*; class MazeMarkPath { public static void main(String[] args) throws Exception { BufferedReader fin = new BufferedReader( new FileReader("DATAMAZE.txt")); main(fin); fin.close(); } static char[][] maze; static int rows, cols; static final char EMPTY = '.'; static final char MARKED = '#'; static final char START = 'S'; static final char END = 'E'; static final char WALL = 'X'; static int[] markx; static int[] marky; private static void main(BufferedReader fin) throws IOException { /* getting input */ String temp = fin.readLine(); rows = Integer.parseInt( temp.substring(0, temp.indexOf(' ') ) ); cols = Integer.parseInt( temp.substring(temp.indexOf(' ') + 1)); maze = new char[rows+2][cols+2]; int startx = -1; int starty = -1; //top and bottom border for (int i = 0; i 0; i++) { if (maze[marky[i]][markx[i]] == EMPTY) maze[marky[i]][markx[i]] = MARKED; } } private static void print(char[][] c) { for (int i = 0; i < c.length ;i++) { for (int j = 0; j < c[0].length ; j++) { System.out.print(c[i][j]); } System.out.println(); } } }