# Arup Guha
# 8/28/2012
# Practice Program #1: Approaching Trains

MIN_IN_HOUR = 60

def main():

    # Reading in train information.
    distance = int(input("What is the distance between the train in miles?\n"))
    rate1 = int(input("What is the speed of the first train in miles per hour?\n"))
    rate2 = int(input("What is the speed of the second train in miles per hour?\n"))

    # Calculate time for trains to meet.
    tHours = distance/(rate1 + rate2)
    tMinutes = tHours*MIN_IN_HOUR

    # Calculate distances both trains travel.
    dTrain1 = rate1*tHours
    dTrain2 = rate2*tHours

    print("It will take",tMinutes,"minutes for the trains to meet.")
    print("The first train will travel",dTrain1,"miles.")
    print("The second train will travel",dTrain2,"miles.")

main()
    

    
