← All problemsSign in

Golf course

CodeChefRating 1748Open on judge ↗

A company wants to invest into building a golf course. They could choose the land to build the course from a rectangle area of size MxN. The rectangle area is divided into MxN cells. They measured the elevation of each cell and recorded it into an integer number. The company decided that the golf course should be a KxK square (K ≤ min(M,N)). Thus, there are (M-K+1)(N-K+1) possible KxK squares tha

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