If PR = 40, what are PQ and QR?

The image consists of a segment PR and point Q is between points P and R. Measure of segment PQ is 5x-2 and that of segment QR is x+12.

A. PQ = 8, QR = 17
B. PQ = 23, QR = 17
C. PQ = 27, QR = 13
D. PQ = 19, QR = 21