Two capacitors of different capacitances are connected first (1) in series and then (2) in parallel across a dc source of \( 100\ \text{V} \). If the total energy stored in the combination in the two cases are \( 40\ \text{mJ} \) and \( 250\ \text{mJ} \) respectively, find the capacitance of the capacitors.