part1 (1586B)
1--- Day 1: The Tyranny of the Rocket Equation --- 2 3Santa has become stranded at the edge of the Solar System while delivering presents to other 4planets! To accurately calculate his position in space, safely align his warp drive, and return to 5Earth in time to save Christmas, he needs you to bring him measurements from [1m[33mfifty stars[0m. 6 7Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent 8calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants 9[1m[33mone star[0m. Good luck! 10 11The Elves quickly load you into a spacecraft and prepare to launch. 12 13At the first Go / No Go poll, every Elf is Go until the Fuel Counter-Upper. They haven't determined 14the amount of fuel required yet. 15 16Fuel required to launch a given [1m[97mmodule[0m is based on its [1m[97mmass[0m. Specifically, to find the fuel 17required for a module, take its mass, divide by three, round down, and subtract 2. 18 19For example: 20 21 22 - For a mass of 12, divide by 3 and round down to get 4, then subtract 2 to get 2. 23 24 - For a mass of 14, dividing by 3 and rounding down still yields 4, so the fuel required is also 2. 25 26 - For a mass of 1969, the fuel required is 654. 27 28 - For a mass of 100756, the fuel required is 33583. 29 30 31The Fuel Counter-Upper needs to know the total fuel requirement. To find it, individually calculate 32the fuel needed for the mass of each module (your puzzle input), then add together all the fuel 33values. 34 35[1m[97mWhat is the sum of the fuel requirements[0m for all of the modules on your spacecraft? 36 37