Let's use an equation to solve this problem.
[tex]y=24x+16[/tex]
Where x is the price of each cupcake, y is the total cost, 16 is the price of the layer cake, and 24 is the number of cupcakes.
[tex]57=24x+16[/tex]
[tex]41=24x[/tex]
[tex]x=\frac{41}{24}[/tex]
Which simplifies around to $1.71 dollars.
Hope this helps.
頑張って!