Rezolvat submat

http://www.infoarena.ro/problema/submat