Along the beach, parking spaces of the same length are marked. Vehicles park in a row, and all drivers observe the marked spaces. The parking lot is reserved only for buses, and each bus occupies exactly three parking spaces.

At a certain moment, only two buses were standing in the parking lot - one occupied the fifth to seventh spaces from the left, the other occupied the eighth to tenth spaces from the right. Later, four more buses parked there, and if one more had arrived, there would not have been enough space for it. Determine the maximum number of parking spaces that could be in the parking lot.

(E. Patáková)
We need to determine the maximum number of spaces on the parking lot, which means we need to find out how inefficiently the buses can be parked. We consider such arrangements where the gaps between buses are as large as possible, and at the same time, no additional bus can fit into these gaps. From the problem statement, it follows that the maximum possible gap consists of two parking spaces.

Let's illustrate how the buses were parked initially:

![](https://cdn.mathpix.com/cropped/2024_04_17_ca6f62942b009cd67ccfg-1.jpg?height=77&width=1122&top_left_y=1178&top_left_x=473)

There are four free spaces before the first bus. One bus can fit there (in two ways).

Behind the second bus, there are seven free spaces. Two buses could fit there; however, if one bus is parked as shown in the following image, no more buses can fit:

![](https://cdn.mathpix.com/cropped/2024_04_17_ca6f62942b009cd67ccfg-1.jpg?height=69&width=1102&top_left_y=1596&top_left_x=480)

The remaining two buses will be parked between the original two buses in the middle section, whose length we do not know. The least efficient arrangement is such that the gap between each pair of buses is exactly two parking spaces:

![](https://cdn.mathpix.com/cropped/2024_04_17_ca6f62942b009cd67ccfg-1.jpg?height=71&width=1396&top_left_y=1912&top_left_x=336)

We see that up to 12 additional spaces can fit between the originally indicated parking spaces. The parking lot can have a maximum of \(7 + 12 + 10 = 29\) parking spaces.

Scoring. 1 point for placing one bus at the left end; 2 points for placing one bus at the right end; 2 points for placing the remaining two buses between the two original ones (1 point for justification); 1 point for the final number of parking spaces.