void dfs(int[][] b, int r, int c, int curMax, int[] max, boolean[][] v) {
		max[0]=Math.max(curMax, max[0]);
		int m=b.length;
		int n=b[0].length;
		int nv=b[r][c]+1;
		v[r][c]=true;
		if (r+1<m&&b[r+1][c]==nv) dfs(b, r+1, c, curMax+1, max, v);
		if (r-1>=0&&b[r-1][c]==nv) dfs(b, r-1, c, curMax+1, max, v);
		if (c-1>=0&&b[r][c-1]==nv) dfs(b, r, c-1, curMax+1, max, v);
		if (c+1<n&&b[r][c+1]==nv) dfs(b, r, c+1, curMax+1, max, v);
	}