Problem: city a to city b , andrew drove for 1 hour at 50 mph and for 3 hours at 60 mph . what was the average speed for the whole trip ?
Rationale: the total distance is 1 × 50 + 3 × 60 = 2301 × 50 + 3 × 60 = 230 . and the total time is 4 hours . hence , average speed = ( total distancetotal time ) = 2304 = 57.5 b
annotated_formula: divide(add(multiply(50, 1), multiply(60, 3)), add(3, 1))