Length of chain hanging from the table = L/n
Mass of chain (only the hanging part) = m/n
Gravitation force on hanging part of the chain = mg/n
Center of mass of the hanging part of the chain is at L/2n from end.( i.e, half of hanging lenght)
therefore, Work done = F.s
= mg/n * L/2n cos180(degrees)
=-mgL/2(n^2 )
Hence, external work done required to pull the hanging length of the chain =mgL/2(n^2 )