4c + 2p = p^2 and (4c-24) + (2p-4) = (p-2)^2