Into a ballistic pendulum a 15.0 g bullet is fired at 840 m/s consisting of a 24.0 kg bag of sand. The bag rises to a height of 80 cm. The energy changed from kinetic to potential to thermal. Determine how the first law of thermodynamics applies to this example.