john and jacob set out together on bicycle traveling at 18 and 15 miles per hour , respectively . after 40 minutes , john stops to fix a flat tire . if it takes john one hour to fix the flat tire and jacob continues to ride during this time , how many hours will it take john to catch up to jacob assuming he resumes his ride at 18 miles per hour ? ( consider john ' s deceleration / acceleration before / after the flat to be negligible )
"john ' s speed - 18 miles / hr jacob ' s speed - 15 miles / hr after 40 min ( i . e 2 / 3 hr ) , distance covered by john = 18 x 2 / 3 = 12 miles . jacob continues to ride for a total of 1 hour and 40 min ( until john ' s bike is repaired ) . distance covered in 1 hour 40 min ( i . e 5 / 3 hr ) = 15 x 5 / 3 = 25 miles . now , when john starts riding back , the distance between them is 13 miles . jacob and john are moving in the same direction . for john to catch jacob , the effective relative speed will be 18 - 15 = 3 miles / hr . thus , to cover 13 miles at 3 miles / hr , john will take 13 / 3 = 4 1 / 3 hours answer e"
divide(add(subtract(18, 15), subtract(15, subtract(multiply(divide(40, const_60), 18), multiply(divide(40, const_60), 15)))), subtract(multiply(divide(40, const_60), 18), multiply(divide(40, const_60), 15)))