A capacitor of capacitance C is charged by a battery of emf E and internal resistance r. A resistance 2r is also connected in series with the capacitor. The amount of heat liberated inside the battery by the time capacitor is 50% charged is
(a) 83E2C
(b) 6E2C
(c) 12E2C
(d) 24E2C