
On a circular racetrack, n players run a fixed number of laps. Every player has her own maximum speed. Player i needs ti units of time for one lap at maximum speed and has to complete ci laps.
On this track a player can pass another player only at the finish line. When a player catches up with a slower player during a lap, she stays right behind him until the end of that lap, so the two cross the finish line at the same moment.
Every player who crosses the finish line at the same moment starts again from there at her own maximum speed, so faster players move ahead of slower ones.
At the start all players stand together at the finish line. A player who completes her last lap leaves the track at once and blocks nobody after that.
Given the lap time and the number of laps of every player, compute the moment each player completes the race.