# Arup Guha
# 1/5/2013
# Solution to Programming Knights Practice Program Chapter 1 Problem 6
# Trains Approaching

MINUTES_PER_HOUR = 60

def main():

    # Read in the input data.
    distance = float(input("Enter the distance separating the trains.\n"))
    vel1 = float(input("What is the speed of train 1?\n"))
    vel2 = float(input("What is the speed of train 2?\n"))

    ''' The time to meet can be calculated by dividing the total
        distance by the effective speed of the two trains together.
        Since the output is to be in minutes, a multiplicative
        factor must be attached.
    '''
    hr_to_meet = distance / (vel1 + vel2);
    min_to_meet = hr_to_meet* MINUTES_PER_HOUR;

    # Print out the result.
    print("It will take",min_to_meet,"minutes to meet.")

    # Print out distances both trains travel.
    # Note: Distance = rate*time, and we had to convert time to hours.
    print("The first train will travel", vel1*hr_to_meet, "miles.")
    print("The second train will travel", vel2*hr_to_meet, "miles.") 


main()
