Flipkart interview question

In 2D binary Array, Find Rectangle/Square in O(n^2*m algorithm) where Rect is represented by 1 at its vertex.