2. (16 points) Aunt Masha decided to bake a cake. She kneaded the dough, which according to the recipe contains flour, butter, and sugar in the weight ratio of $3: 2: 1$, and mixed butter with sugar for the cream in the ratio of 2:3. Changing her mind about baking the cake, she combined both mixtures, added 200 g of flour, and prepared dough for cookies, in which flour, butter, and sugar are in the ratio of 5:3:2. How much butter did Aunt Masha use? Write the answer in grams.
Answer: 480.

Solution. Let the cake dough contain flour, butter, and sugar in the amounts of $3 x$, $2 x$, and $x$ respectively, and the cream contain butter and sugar in the amounts of $2 y$ and $3 y$ respectively. Using the ratios for the cookies, we get the system of equations $\left\{\begin{array}{l}\frac{3 x+200}{2 x+2 y}=\frac{5}{3}, \\ \frac{2 x+2 y}{x+3 y}=\frac{3}{2} .\end{array}\right.$ After transformations, we get the system $\left\{\begin{array}{c}x+10 y=600, \\ x-5 y=0 .\end{array}\right.$ From which we find that $x=200, y=40$. Therefore, Aunt Masha spent $2 x+2 y=400+80=480$ grams of butter.