Given an m×n grid with cells marked 1 for homes and 0 otherwise, choose a single meeting cell that minimizes the sum of Manhattan distances from all homes to that cell. Return both the minimal total distance and one optimal cell. Then extend the design to a dynamic setting that supports operations addHome(i, j), removeHome(i, j), and query() -> (cell, distance). What data structures would you use for the static and dynamic cases, and what are the time and space complexities? Discuss why your approach prefers medians over averages and how you would handle large sparse grids.