Maximize the GBP
CodeChefOpen on judge ↗
Berland is a small country represented as a grid with $N×M$ blocks (N adjacent rows with M adjacent column). Each block has either a stock exchange or it is a residential block. Berland has exactly $5$ stock exchanges and hence $N×M - 5$ residential blocks. Location of all stock exchanges is fixed. You are given location of all $5$ stock exchanges in the form of Ri, Ci which means that ith stoc
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.
Sign in to chat with the tutor and save your progress.
Sign in to start