# Arup Guha
# 9/3/2020
# Calculates information about two trains going towards each other.

# Get all the information.
totalD = int(input("How far apart in miles are the two trains?\n"))
speed1 = int(input("How fast in miles per hour is train 1?\n"))
speed2 = int(input("How fast in miles per hour is train 2?\n"))

# Get the time to meet in hours.
timeToMeet = totalD/(speed1+speed2)

# Convert to minutes.
minToMeet = 60*timeToMeet

# Output how many minutes to meet.
print("The trains will meet after",minToMeet,"minutes.")

# Calculate the first distance.
dist1 = speed1*timeToMeet

# We can use that to output how far both trains went.
print("The first train traveled", dist1,"miles.")
print("The second train traveled", totalD-dist1,"miles.")
