# Arup Guha
# 1/5/2013
# Solution to Programming Knights Practice Program Chapter 1 Problem 4
# Road Trip

def main(): 

    # Get user input.
    gasPrice = float(input("What is the price in dollars of gasoline, per gallon?\n"))
    gasLeft = float(input("How much gas do you have left in your tank?\n"))
    mpg = float(input("What gas mileage, in miles per gallon, does your car get?\n"))
    distance = float(input("How far is your road trip, in miles?\n"))

    # Go ahead and drive until the tank is empty.
    distance = distance - gasLeft*mpg;

    # Calculate amount of gas needed and its cost.
    gallonsNeeded = distance/mpg;
    cost = gallonsNeeded*gasPrice;

    # Output result.
    print("You will need to spend",cost,"on your road trip for gas.\n")


main()
