we have the following:
x is small pizzas
y is medium pizzas
[tex]\begin{gathered} 5.75\cdot x+8\cdot y=51.5 \\ y=x+3 \\ 5.75\cdot x+8\cdot(x+3)=51.5 \\ 5.75x+8x+24=51.5 \\ 13.75x=51.5-24 \\ x=\frac{27.5}{13.75} \\ x=2 \end{gathered}[/tex]therefore, the answer is:
2 small pizzas and 5 (2+3) medium pizzas