Isobaric heat capacity and structure of water and heavy water in the liquid state