IMO 1988 LL HKG32

Assuming that the roots of x3+px2+qx+r = 0 are all real and

IMO 1988 LL HKG32

Origin: HKG

Problem

Assuming that the roots of x3+px2+qx+r = 0 are all real and positive, find a relation between p, q, and r that gives a necessary condition for the roots to be exactly the cosines of three angles of a triangle.