Solved 3251-Big Square http://poj.org/problem?id=3251