there n car travel different speed direction onelane road you give array car length n carsi positioni speedi representspositioni distance ith car begin road meter it guarantee positioni positioni1speedi initial speed ith car meter secondFor simplicity car consider point move number line two car collide occupy position once car collide car unite form single car fleet the car form fleet position speed initial speed slow car fleetreturn array answer answeri time second ith car collide car 1 car collide car Answers 105 actual answer accept Example 1input car 12214372output 100000100000300000100000explanation after exactly second car collide second car form car fleet speed 1 ms after exactly 3 second car collide fourth car form car fleet speed 2 msexample 2input car 34546391output 200000100000150000100000 Constraints1 carslength 1051 positioni speedi 106positioni positioni1