# https://adventofcode.com/2019/day/1

import math

total_fuel = 0
for line in open('inputs/day_1.txt'):
    mass = int(line.rstrip('\n'))
    while mass > 0:
        mass = math.floor(mass/3)-2
        total_fuel += mass if mass > 0 else 0

print(total_fuel)
8f8f7a161e501dca2308f6a6c8517d32ca15de30
<mask token>

<mask token>
for line in open('inputs/day_1.txt'):
    mass = int(line.rstrip('\n'))
    while mass > 0:
        mass = math.floor(mass / 3) - 2
        total_fuel += mass if mass > 0 else 0
print(total_fuel)

<mask token>
total_fuel = 0
for line in open('inputs/day_1.txt'):
    mass = int(line.rstrip('\n'))
    while mass > 0:
        mass = math.floor(mass / 3) - 2
        total_fuel += mass if mass > 0 else 0
print(total_fuel)

import math
total_fuel = 0
for line in open('inputs/day_1.txt'):
    mass = int(line.rstrip('\n'))
    while mass > 0:
        mass = math.floor(mass / 3) - 2
        total_fuel += mass if mass > 0 else 0
print(total_fuel)

# https://adventofcode.com/2019/day/1

import math

total_fuel = 0
for line in open('inputs/day_1.txt'):
    mass = int(line.rstrip('\n'))
    while mass > 0:
        mass = math.floor(mass/3)-2
        total_fuel += mass if mass > 0 else 0

print(total_fuel)