we have the following system
[tex]\begin{gathered} \begin{cases}x+y=60 \\ 5x+2y=246\end{cases} \\ \end{gathered}[/tex]where x is the number of mega million ticktets and y the number of scratch off tickets, so we have that y=60-x and we get that
[tex]\begin{gathered} 5x+2(60-x)=246 \\ 5x-2x+120=246 \\ 3x=126 \\ x=\frac{126}{3}=42 \end{gathered}[/tex]so they bought 42 mega million tickets and 18 scratch off