To determine the minimum time required so that all the tomatoes become rotten, and understanding the application of BFS in this scenario using C++.