← All problemsSign in

Wall Painting

Chef wanted to paint a wall in his house, but he did not like the way ordinary people paint walls. So he invented a new machine that can do so. Consider the wall to be a rectangular grid of height N and width M such that the top-left corner is (1, 1) and the bottom-right corner is (N, M). Chef can input the coordinates of the top-left corner and the bottom-right corner of any rectangle on this gri

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