1. There are 5 pieces of transparent glass of the same square shape and size. Each piece of glass is conditionally divided into 4 equal parts (right triangles) by its diagonals, and one of these triangles is painted with an opaque paint of its individual color, different from the colors of the painted parts of the other glasses. Then all these glasses are stacked on top of each other (with precise alignment of edges and vertices) with the painted parts facing up. How many different ways are there to stack the glasses so that the entire stack ends up completely opaque in the vertical direction. (12 points)
Solution. First, consider some fixed vertical order of laying the glasses (from bottom to top). It is clear that by rotating the entire layout by some angle, we will not change the layout (we will not get a new layout). Therefore, we can assume that the bottom glass in the layout is always fixed (does not rotate). Then the layouts (with a fixed vertical order of glasses) will differ from each other by the rotation of each of the subsequent 4 upper glasses by $0^{\circ}, 90^{\circ}, 180^{\circ}$, and $270^{\circ}$ relative to the fixed bottom glass. Therefore, we will get a total of $4^{4}=256$ layout options with a fixed vertical order of glasses. Adding now all possible vertical permutations of the five glasses (5! = 120 options), we get the total number of possible glass layouts in a stack: $5!4^{4}=120 \cdot 256=30720$ pieces. But not all these layouts meet the condition of the problem. The layouts that meet the condition of the problem are only those in which the entire stack turns out to be vertically opaque. Consider columns of triangles located above each of the four fixed triangles of the bottom glass. The condition of the problem will be met when each of these four columns is opaque. In this case, one of these columns is already opaque by default (the one that stands on the bottom shaded triangle). Consider the ordered set (vector) of possible angles of rotation (for definiteness, clockwise) of the shaded triangles on each of the 4 upper glasses relative to the bottom shaded triangle: $\left(\alpha_{1}, \alpha_{2}, \alpha_{3}, \alpha_{4}\right)$, where $\alpha_{k} \in\left\{0^{\circ}, 90^{\circ}, 180^{\circ}, 270^{\circ}\right\}, k=1,2,3,4$.

All "columns" of glass triangles will be opaque if in this set of rotation angles there is at least one angle $90^{\circ}$, at least one angle $180^{\circ}$, and at least one angle $270^{\circ}$ (while the angle $0^{\circ}$ does not have to appear, although it will not hurt if it does appear). To count the total number of such sets (and thus the number of layouts with a fixed vertical order of glasses), we will divide them into four groups:

- sets in which all rotation angles are different, i.e., all $\alpha_{k}$ are pairwise different, such sets (due to permutations) are a total of $4!=24$ pieces;
- sets in which the rotation angles $180^{\circ}$ and $270^{\circ}$ appear once each, and the rotation angle $90^{\circ}$ appears twice, such sets (due to permutations) are a total of $6 \cdot 2=12$ pieces (here 6 is the number of places in the vector for two angles of $90^{\circ}$, and 2 is the two permutations of the angles $180^{\circ}$ and $270^{\circ}$ in the remaining two places);
- sets in which the rotation angles $90^{\circ}$ and $270^{\circ}$ appear once each, and the rotation angle $180^{\circ}$ appears twice; similarly, such sets (due to permutations) are also a total of $6 \cdot 2=12$ pieces;
- sets in which the rotation angles $90^{\circ}$ and $180^{\circ}$ appear once each, and the rotation angle $270^{\circ}$ appears twice; similarly, such sets (due to permutations) are a total of $6 \cdot 2=12$ pieces.

In the end, we get a total of $24+12+12+12=60$ ordered sets of rotation angles that meet the required condition. This is the total number of layouts with a fixed vertical order of glasses, in which the final stack turns out to be opaque. Finally, by permuting the glasses $5!=120$ ways, we get the total number of $120 \cdot 60=7200$ layouts, in which the final stack turns out to be opaque.

Answer: 7200 ways.