Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Rectangle Additions on a Grid

An r x c grid starts at zero. Each update (r1, c1, r2, c2, v) adds v to every cell inside the rectangle (inclusive, 0-indexed). Print the final grid.

Constraints

1 <= r, c <= 1000 1 <= q <= 10^5

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.