Воробьев Егор Александрович, 419/2 (КФ) RaceTesting 10102
Арсен Жуматай,304 RaceTesting 12787
t1from itertools import cycle, islicet1from itertools import cycle, islice
22
3def speed(path, stops, times):3def speed(path, stops, times):
4    stops_cycle = cycle(stops)4    stops_cycle = cycle(stops)
5    path_iter = iter(path)5    path_iter = iter(path)
6    time_iter = iter(times)6    time_iter = iter(times)
7    while True:7    while True:
8        stop_count = next(stops_cycle)8        stop_count = next(stops_cycle)
9        distance = sum(islice(path_iter, stop_count))9        distance = sum(islice(path_iter, stop_count))
10        if distance == 0:10        if distance == 0:
11            break11            break
12        time_spent = next(time_iter)12        time_spent = next(time_iter)
13        yield (distance / time_spent)13        yield (distance / time_spent)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op