If I add 24,059 J of energy to an ideal gas inside a balloon, causing the internal energy to increase by 7,851 J, how much work is done on the environment by the gas as the balloon expands?