The useful work here is to raise the water and bucket as high as H, so the useful work is (g water +g bucket) H.
Because it is a moving pulley, the object rises H .. and then the rope F goes for 2 hours (the law of moving pulley). Total work =f*2h.
So the mechanical efficiency η = (gram water+gram barrel) h/
f*2h
The weight of the bucket may be given in the exam ... don't worry.