How is this problem done? it's not coming out right for me.

solve for c: x = p(1/a + m/c)

cax=pc+ ma
c(ax-p)=ma
then divide by ax-p check my thinking.