==> $ - 30 = ({U_f} - 30) - 10$ ==> ${U_f} = 10\,J$
$(i)$ Sequentially keeping in contact with $2$ reservoirs such that each reservoir supplies same amount of heat.
$(ii)$ Sequentially keeping in contact with 8 reservoirs such that each reservoir supplies same amount of heat.
In both the cases body is brought from initial temperature $100^{\circ}\,C$ to final temperature $200^{\circ}\,C$. Entropy change of the body in the two cases respectively is :

