Explanation:
P and Q can do the whole work in 12 hours.
so, in 1 hour they can do 1/12.
P and R can do in 1 hour 1/15.
Q and R can do in 1 hour 1/20.
mathematically that looks like
P + Q = 1/12
P + R = 1/15
Q + R = 1/20
P + Q + R = 1/x
together they can do 1/x of the work in 1 hour.
it will take them x hours, if all 3 worked together.
from the first equation we get
P = 1/12 - Q
that gives us in the second equation
1/12 - Q + R = 1/15
R = 1/15 - 1/12 + Q = 4/60 - 5/60 + Q = Q - 1/60
but from the 3rd equation we get also
R = 1/20 - Q
so,
Q - 1/60 = 1/20 - Q
2Q = 1/20 + 1/60 = 3/60 + 1/60 = 4/60
Q = 2/60 = 1/30
R = Q - 1/60 = 2/60 - 1/60 = 1/60
P = 1/12 - Q = 1/12 - 2/60 = 5/60 - 2/60 = 3/60 = 1/20
so, we get for the sum :
P + Q + R = 3/60 + 2/60 + 1/60 = 6/60 = 1/10
that means in 1 hour they can do together 1/10 of the work.
so, together they will need 10 hours to paint the fence.