Grid Game
CodeChefOpen on judge ↗
Bhima and Arjun are playing a game. In the game, Bhima gave Arjun a grid A of size N × M, i.e. containing N rows and M columns. Then Bhima asks Q queries to Arjun which Arjun has to answer correctly to win the game. In each query Bhima gives two coordinates (a, b) and (x, y) to Arjun. Arjun has to tell the sum of all the elements of the grid which lies within the bounds of the given coordinates,
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