Editorial for CCC '25 S1 - Positioning Peter's Paintings
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
The perimeter of a rectangle is where
and
are the height and length of the rectangle.
Subtask 1
In this subtask, both squares are congruent. Let the side length of the paintings be . An optimal configuration for all such cases is shown below.
Here, we see that the length of the rectangle with the smallest perimeter that encloses the two paintings has height of and length of
. This means that the perimeter is
.
Subtask 2
For this subtask, we have two squares. Let the side lengths of the paintings be and
for Painting 1 and Painting 2, respectively. The best configuration is to put them side by side. An example of the optimal configuration is shown below.
Here, we see that the perimeter of the rectangle with the smallest perimeter that encloses the two paintings has a height of and length of
. Thus, we see that the answer is
.
Subtask 3
For the last subtask, assume Painting 1 has a length of and a height of
and Painting 2 has a length of
and a height of
. Like in previous subtasks, the optimal configuration may be to put them side by side. However, there may be another case of stacking one painting on top of another painting. As such, we will take the minimum perimeter of each case.
- Placed side by side: The best enclosed rectangle has a height of
and a length of
. Hence, the perimeter is
.
- Stacked on top of each other: The best enclosed rectangle has a height of
and a length of
. Hence, the perimeter is
.
Thus, the answer is .
Comments