Finding Primes!

$$a$$, $$b$$, $$c$$ and $$d$$ are integers such that $$0<a,b,c,d<999$$ and $$ab=cd$$.

How many ordered sets of integers $$(a,b,c,d)$$ satisfy

$a+b+c+d=p$

where $$p$$ is a prime number?

×