A trolley travelling along a rail carries a hanging weight $W$. As the trolley shifts horizontally by a distance $p$, it at the same time lifts the weight upward by a height $q$. Consequently, the weight travels a distance $r$ from X to Y. It is at rest at the beginning and also at the end. What amount of work is done on the weight in this process?
- A$Wp$
- B$W(p + q)$
- C$Wq$
- D$Wr$