What is the oxygen balance equation?

How is the oxygen balance calculated for any molecule with the formula CaHbNcOd?
The oxygen balance of any explosive of general formula CaHbNcOd with a molecular weight M can be calculated as shown in the picture.
If the oxygen balance is less than zero the carbon and hydrogen cannot be fully oxidised.

What are the K-W rules?

What is the equation for the heat of detonation?

How is the volume of detonation calculated?
C4H8N8O8 → 4CO + 4H2O + 4N2
Or per kg of HMX:
V = 268.8 x (1000/296) = 908.1 L kg-1
How is explosive power calculated from the enthalpy of reaction and volume of detonation?
Explosive power = Q x V
Explosive power (HMX) = 5010 kJ kg-1 x 908.1 L kg-1
= 4.550 x 106 kJ L kg-2