Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1 1 1 1 0 0
0 1 0 1 0 1 1 1
0 1 1 0 1 1 1 1
0 1 1 1 0 1 1 0
1 1 1 0 1 0 1 0
0 1 1 1 0 1 1 1
0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1

Answer:
1 2 1 2 1 1 0 0
0 1 0 1 0 1 1 1
0 1 1 0 1 2 2 1
0 1 2 1 0 1 1 0
1 2 1 0 1 0 1 0
0 1 2 1 0 1 2 1
0 1 2 2 1 2 3 2
1 2 3 3 2 3 4 3


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 0 1 1 1 1 1 0
0 0 1 1 1 1 1 1
1 0 1 0 0 1 1 1
0 1 1 1 0 0 1 0
1 1 0 1 0 0 1 1
0 1 1 1 0 1 1 1
1 1 0 0 1 0 1 0
1 1 0 1 1 1 1 0

Answer:
0 0 1 2 2 2 1 0
0 0 1 1 1 2 2 1
1 0 1 0 0 1 2 1
0 1 1 1 0 0 1 0
1 1 0 1 0 0 1 1
0 1 1 1 0 1 2 1
1 1 0 0 1 0 1 0
2 1 0 1 2 1 1 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1 0 0 0 1 1 1 1
1 1 1 1 1 0 1 1 1 0
1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 0 1 1 1 1
1 1 1 1 1 0 0 0 1 1
1 0 1 1 1 1 0 1 1 1
1 1 0 0 1 1 1 1 1 1
0 0 1 1 1 0 1 1 0 1
0 1 1 1 1 1 1 1 0 1
1 0 1 0 1 1 0 0 1 0

Answer:
3 2 1 0 0 0 1 2 2 1
2 3 2 1 1 0 1 2 1 0
1 2 3 2 2 1 2 2 2 1
0 1 2 2 1 0 1 1 2 2
1 1 2 2 1 0 0 0 1 2
1 0 1 1 2 1 0 1 2 3
1 1 0 0 1 1 1 2 1 2
0 0 1 1 1 0 1 1 0 1
0 1 2 1 2 1 1 1 0 1
1 0 1 0 1 1 0 0 1 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 0 1
1 0 1
0 1 1

Answer:
1 0 1
1 0 1
0 1 2


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1 1
1 1 0 1
1 1 1 1
1 1 1 1

Answer:
3 2 1 2
2 1 0 1
3 2 1 2
4 3 2 3


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 0 1 1 1 1 1 1
1 1 0 1 1 1 1 0
1 1 1 0 1 1 0 0
0 1 1 0 1 1 0 1
0 1 1 1 1 1 1 0
1 1 0 1 0 1 1 1
1 0 1 1 0 1 1 1
1 1 1 1 1 1 0 1

Answer:
0 0 1 2 3 3 2 1
1 1 0 1 2 2 1 0
1 2 1 0 1 1 0 0
0 1 1 0 1 1 0 1
0 1 1 1 1 2 1 0
1 1 0 1 0 1 2 1
1 0 1 1 0 1 1 2
2 1 2 2 1 1 0 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 0 1 1 1 0 0 1 0 1
1 0 1 0 1 1 0 0 1 0
1 1 1 1 1 1 1 1 0 1
1 0 0 1 1 1 0 1 1 0
1 1 1 0 1 1 1 1 0 1
1 1 1 1 1 1 0 0 1 1
1 1 1 1 0 0 0 1 1 1
1 0 0 0 1 1 1 0 1 0
1 1 1 0 1 0 1 1 1 0
1 1 1 1 1 1 1 0 1 1

Answer:
0 0 1 1 1 0 0 1 0 1
1 0 1 0 1 1 0 0 1 0
2 1 1 1 2 2 1 1 0 1
1 0 0 1 2 1 0 1 1 0
2 1 1 0 1 2 1 1 0 1
3 2 2 1 1 1 0 0 1 2
2 1 1 1 0 0 0 1 2 1
1 0 0 0 1 1 1 0 1 0
2 1 1 0 1 0 1 1 1 0
3 2 2 1 2 1 1 0 1 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1 1 0 1 0 0 1
0 1 1 1 1 1 1 1 1
1 1 0 0 0 1 0 0 0
1 1 0 0 1 1 1 1 1
1 1 0 0 0 1 1 0 0
1 1 1 0 1 0 1 0 1
1 0 1 1 1 0 0 1 0
1 0 1 0 0 1 0 1 1
1 1 1 1 1 0 0 1 1

Answer:
1 2 2 1 0 1 0 0 1
0 1 1 1 1 2 1 1 1
1 1 0 0 0 1 0 0 0
2 1 0 0 1 2 1 1 1
2 1 0 0 0 1 1 0 0
2 1 1 0 1 0 1 0 1
1 0 1 1 1 0 0 1 0
1 0 1 0 0 1 0 1 1
2 1 2 1 1 0 0 1 2


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 0
1 1 1
0 1 1

Answer:
0 1 0
1 2 1
0 1 2


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 0 1
1 0 1 0
1 1 1 0
1 1 0 1

Answer:
2 1 0 1
1 0 1 0
2 1 1 0
2 1 0 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 0 1 1 0
0 1 1 1 1
0 1 0 1 1
1 1 1 1 0
1 1 1 1 1

Answer:
1 0 1 1 0
0 1 1 2 1
0 1 0 1 1
1 2 1 1 0
2 3 2 2 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 0 1 0 1
1 0 1 0 1
1 1 1 1 1
1 1 1 0 1
1 1 1 0 0

Answer:
1 0 1 0 1
1 0 1 0 1
2 1 2 1 2
3 2 1 0 1
3 2 1 0 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 0 1 1 1 0 1 1 0
1 1 0 1 0 1 1 1 1 0
0 0 1 1 1 1 0 1 1 0
1 1 1 0 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 1 1 0 0
0 1 0 1 0 1 1 1 1 0
1 0 1 1 0 1 1 1 1 0
1 0 1 1 0 1 1 0 0 1
1 1 1 0 1 1 1 1 1 1

Answer:
0 1 0 1 1 1 0 1 1 0
1 1 0 1 0 1 1 2 1 0
0 0 1 1 1 1 0 1 1 0
1 1 1 0 1 2 1 2 2 1
2 2 2 1 2 1 2 2 1 1
1 2 1 2 1 0 1 1 0 0
0 1 0 1 0 1 2 2 1 0
1 0 1 1 0 1 2 1 1 0
1 0 1 1 0 1 1 0 0 1
2 1 1 0 1 2 2 1 1 2


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1
1 1 0
1 1 0

Answer:
3 2 1
2 1 0
2 1 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1 1 0 1
1 1 1 0 1 0
1 0 1 1 1 1
1 0 0 1 1 1
0 1 1 1 1 1
1 1 0 1 1 0

Answer:
3 2 2 1 0 1
2 1 1 0 1 0
1 0 1 1 2 1
1 0 0 1 2 2
0 1 1 2 2 1
1 1 0 1 1 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1
0 1 1
0 1 1

Answer:
1 2 3
0 1 2
0 1 2


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 0
0 1 1
1 0 0

Answer:
1 1 0
0 1 1
1 0 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 0 1 1 1
1 1 1 1 1 1 0 0 1 1
1 1 1 1 1 1 0 0 0 1
0 1 1 1 0 1 1 1 1 0
0 1 1 1 1 0 1 1 1 1
0 1 1 1 0 1 1 0 1 1
0 1 0 0 1 1 1 0 0 0
1 0 1 1 0 1 1 0 1 0
1 1 0 1 1 0 0 0 1 1

Answer:
0 1 2 3 2 1 1 2 3 4
1 2 3 2 1 0 0 1 2 3
2 3 4 3 2 1 0 0 1 2
1 2 3 2 1 1 0 0 0 1
0 1 2 1 0 1 1 1 1 0
0 1 2 2 1 0 1 1 2 1
0 1 1 1 0 1 1 0 1 1
0 1 0 0 1 2 1 0 0 0
1 0 1 1 0 1 1 0 1 0
2 1 0 1 1 0 0 0 1 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 0 1 1 1 1
1 1 1 1 1 1 0
1 0 1 1 1 0 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 0 1 1 1 1 0
1 1 1 1 1 0 1

Answer:
0 1 0 1 2 2 1
1 1 1 2 2 1 0
1 0 1 2 1 0 1
2 1 2 3 2 1 2
2 1 2 3 3 2 1
1 0 1 2 2 1 0
2 1 2 2 1 0 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 1
0 1 1
1 1 1

Answer:
0 1 2
0 1 2
1 2 3


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 1
1 1 0
1 1 1

Answer:
0 1 1
1 1 0
2 2 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 1 1 1 1 1 1 1
1 1 1 1 0 1 1 0 0
1 0 1 1 1 1 0 0 1
1 1 1 1 0 1 1 1 1
1 1 1 1 1 0 0 0 1
1 1 1 1 0 1 1 1 0
1 1 1 1 1 0 1 0 0
0 1 0 1 1 0 1 1 1
0 1 0 1 0 1 0 1 1

Answer:
0 1 2 2 1 2 2 1 1
1 1 2 1 0 1 1 0 0
1 0 1 2 1 1 0 0 1
2 1 2 1 0 1 1 1 2
3 2 3 2 1 0 0 0 1
2 3 2 1 0 1 1 1 0
1 2 1 2 1 0 1 0 0
0 1 0 1 1 0 1 1 1
0 1 0 1 0 1 0 1 2


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 0 0 1 0 0
0 1 1 0 0 1
1 1 0 0 0 1
1 1 1 0 1 1
1 1 1 1 1 0
1 1 0 1 1 1

Answer:
1 0 0 1 0 0
0 1 1 0 0 1
1 1 0 0 0 1
2 2 1 0 1 1
3 2 1 1 1 0
2 1 0 1 2 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 1
1 1 0
1 0 0

Answer:
0 1 1
1 1 0
1 0 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 0 1 1 1 1 1 1 1 1
1 0 1 1 1 0 1 0 1 1
1 1 1 1 1 1 0 1 1 0
1 1 1 0 0 1 1 1 1 1
1 0 1 1 1 1 1 1 1 1
0 0 0 0 0 1 1 0 0 1
1 1 0 1 1 1 0 1 0 1
0 0 1 0 1 0 1 1 1 1
1 1 1 1 1 0 1 1 0 1
0 0 1 0 1 0 1 1 1 1

Answer:
1 0 1 2 2 1 2 1 2 2
1 0 1 2 1 0 1 0 1 1
2 1 2 1 1 1 0 1 1 0
2 1 1 0 0 1 1 2 2 1
1 0 1 1 1 2 2 1 1 2
0 0 0 0 0 1 1 0 0 1
1 1 0 1 1 1 0 1 0 1
0 0 1 0 1 0 1 2 1 2
1 1 2 1 1 0 1 1 0 1
0 0 1 0 1 0 1 2 1 2


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 1 0 1 0 0 1 1
1 0 0 1 1 1 0 1 1
1 1 1 0 1 1 1 1 1
0 1 1 0 0 0 0 1 0
0 1 1 0 1 0 1 1 1
1 1 0 0 1 1 1 1 0
0 1 1 1 0 0 0 0 1
1 1 0 0 1 0 1 1 0
1 0 1 1 0 1 0 0 1

Answer:
2 1 1 0 1 0 0 1 2
1 0 0 1 2 1 0 1 2
1 1 1 0 1 1 1 2 1
0 1 1 0 0 0 0 1 0
0 1 1 0 1 0 1 2 1
1 1 0 0 1 1 1 1 0
0 1 1 1 0 0 0 0 1
1 1 0 0 1 0 1 1 0
1 0 1 1 0 1 0 0 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 0 1
1 1 1 1
0 1 1 0
1 0 0 1

Answer:
2 1 0 1
1 2 1 1
0 1 1 0
1 0 0 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 1 0
1 1 1 1
0 0 1 0
1 1 1 1

Answer:
0 1 1 0
1 1 2 1
0 0 1 0
1 1 2 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
0 1 1 0 1
0 0 1 1 0
1 1 0 1 1
1 1 1 1 0
0 0 0 0 0

Answer:
0 1 1 0 1
0 0 1 1 0
1 1 0 1 1
1 1 1 1 0
0 0 0 0 0


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 0 1 1 1 0
1 1 0 0 1 0 1
1 1 1 1 1 0 1
0 1 1 1 0 1 1
1 1 1 0 1 1 1
1 1 1 1 1 1 0
1 1 1 0 1 0 1

Answer:
2 1 0 1 2 1 0
2 1 0 0 1 0 1
1 2 1 1 1 0 1
0 1 2 1 0 1 2
1 2 1 0 1 2 1
2 3 2 1 2 1 0
3 2 1 0 1 0 1


Question:
Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.

The output should be a matrix of the same size as the input matrix, where each cell contains the distance to the nearest 0.

Find the distance to the nearest 0 for each cell in the matrix below:
1 1 0 0 1 0 1 1 1 1
1 1 1 1 1 1 0 1 1 1
1 1 1 0 0 1 1 1 1 1
0 0 1 1 0 0 0 1 1 0
1 1 0 1 1 1 1 1 1 1
0 0 1 1 1 1 1 0 0 1
0 1 0 0 1 1 1 1 1 1
1 1 1 0 1 0 0 1 1 1
1 1 0 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1 1

Answer:
2 1 0 0 1 0 1 2 3 3
2 2 1 1 1 1 0 1 2 2
1 1 1 0 0 1 1 2 2 1
0 0 1 1 0 0 0 1 1 0
1 1 0 1 1 1 1 1 1 1
0 0 1 1 2 2 1 0 0 1
0 1 0 0 1 1 1 1 1 2
1 2 1 0 1 0 0 1 2 3
2 1 0 1 2 1 1 2 3 4
2 1 0 1 2 2 2 3 4 5