5. At the ceremony marking the City Day, a tribune was set up where the spectators were properly arranged in 12 rows and a certain number of columns. Each spectator has either a cap or a hat on their head. The mayor noticed that in each of the 12 rows of the tribune, there are exactly 6 spectators with caps, and in each column of the tribune, there are exactly 5 spectators with hats. There are a total of 5 empty seats on the tribune.

a) How many spectators are on the tribune?

b) Show an example of a seating arrangement that meets the conditions of the problem.
## Solution.

a) Let $s$ be the number of columns. The total number of seats is then $12s$.

On the other hand, the total number of seats is equal to the sum of the number of spectators with caps, which is 72, the number of spectators with hats, which is $5s$, and the number of empty seats, which is 5.

Thus, we have $12s = 72 + 5s + 5$, or $7s = 77$, i.e., $s = 11$.

There are 11 columns on the stand, and $12 \cdot 11 - 5 = 127$ spectators.

b) An example of a seating arrangement that meets the required conditions:

| K | K | K | K | K | K | S | S | S | S | S |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| S | K | K | K | K | K | K | S | S | S | S |
| S | S | K | K | K | K | K | K | S | S | S |
| S | S | S | K | K | K | K | K | K | S | S |
| S | S | S | S | K | K | K | K | K | K | S |
| S | S | S | S | S | K | K | K | K | K | K |
| K | S | S | S | S | S | K | K | K | K | K |
| K | K | S | S | S | S | S | K | K | K | K |
| K | K | K | S | S | S | S | S | K | K | K |
| K | K | K | K | S | S | S | S | S | K | K |
| K | K | K | K | K | S | S | S | S | S | K |
| K | K | K | K | K | K | S | S | S | S | S |

We use K to denote spectators with caps, S to denote spectators with hats, and the rest are empty seats.

Notice that after arranging the first eleven rows as shown above, in the last row, we can arrange the spectators with caps on any 6 seats, while the rest remain empty.