Descriptions:

Rectangle Painting 1

CodeForces - 1199F