Editorial for Another Contest 9 Problem 1 - Black Room Boy
Submitting an official solution before solving the problem yourself is a bannable offence.
The bounds are sufficiently low for this problem that many different approaches work.
For people who know about sets, one can loop over all pairs of integers and assign those to be in the horizontal direction, and the other two integers summed are assigned to the vertical direction. These pairs of sums can be thrown into a set and then printed in order.
For people who don't know sets, one can brute force all rectangular rooms that have perimeter equal to ~d_1 + d_2 + d_3 + d_4~ and check which are valid.