← All problemsSign in

Maximum Building II

CSESAdditional Problems IIOpen on judge ↗

You are given a map of a forest where some squares are empty and some squares have trees. You want to place a rectangular building in the forest so that no trees need to be cut down. For each building size, your task is to calculate the number of ways you can do this. Input The first input line contains integers n and m: the size of the forest. After this, the forest is described. Each square

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start