Description: 250. Constructive Plan
time limit per test: 0.25 sec.
memory limit per test: 65536 KB
input: standard
output: standard
Oh, no! - Petya said, walking around his recently bought ground plot. Petya wants to build a new house on it. According to Petya s building project the house should look above like C character.
There are many trees growing on Petya s plot. But everyone who cuts down a tree in Petya s country is sent to cut down trees for the rest of his life. So first of all Petya has to choose a place for building the house without cutting any tree.
He is feeling that he is not able to find the solution on his own, so he decided to ask you to help him.
The task is simplified a little by the fact that Petya s plot has a rectangular shape of size N*M, divided into 1*1 square cells. For each cell it is known whether there are any trees growing there. House can t occupy cells where trees grow.
Fortunately Petya could explain how his house must look above.
1) H
To Search:
File list (Check if you may need any files):
sgu250.cpp