X+x+y=50, so y=50-2x.
2x+5x+ 10y=240
Replace the second type with the first type.
7x+500-20x=240
x=20
So y= 10
So the number of 5 yuan in 2 yuan is 20, and the number of 10 yuan is 10.
I hope I can help you.