Mass = m
length = l
mass per unit length, M = (m/l)
One fifth is hanging from the edge.
So length of hanging part = l/5
Centre of mass of the hanging part will be at mid point of hanging part
So CM will be at = (l/5) / 2 = l/10.
mass of hanging part = M×(l/5) = (m/l) × (l/5) = m/5
So the problem is equivalent to lifting an object of mass m/5 to a height of l/10.
Work done = mgh = (m/5)×g×(l/10) = mgl/50