Company: TBO_3july
Difficulty: easy
Food Distribution Some people are stuck in different parts of a city. A map uses `0` for a part of the city where people are stuck and `1` for every other part. The government wants to distribute food to each connected group. Given an `N` by `M` binary map, count the number of groups of `0` cells. Two cells belong to the same group when they share an edge, directly or through other zero cells. Input Read `N` and `M`, followed by `N` rows containing `M` binary integers. Output Print the number of connected groups of zero cells. Notes Connectivity is four-directional: up, down, left, and right. Diagonal cells are not adjacent.