# Arup Guha
# 9/1/2020
# Road Trip

# Get the user input.
costPerGallon = float(input("What's the cost of a gallon of gas?\n"))
galInTank = float(input("How many gallons of gas are in the tank now?\n"))
milesPerGal = float(input("How many miles per gallon does your car get?\n"))
length = int(input("How many miles long is your road trip?\n"))

# How far we can drive.
canDrive = galInTank*milesPerGal

# Update how far we have to go by subtracting how our initial drive.
length = length - canDrive

# Figure out how many gallons I have to buy.
gallonsNeeded = length/milesPerGal

# Multiply gallons by cost per gallon and output cost.
print("The road trip will cost $", gallonsNeeded*costPerGallon,".", sep="")
