Tree Extermination
In an n×n grid, information about the number of trees and walls is provided.
Due to the high growth and reproduction rate of the trees, herbicide is used to suppress tree growth. The herbicide spreads diagonally within a range of k, but it is blocked by walls and does not propagate further.