Police Investigation 4 (police4)

73 teams scored 2740 points on this task, for a maximum score of 100, an average score of 38 and a median score of 25.

Highlights

  1. Banfi, Vimercate is the institute with the most points (165).
  2. Lombardia is the region with the most points (615).

Statement

Fearsome William is still free, and the Police is searching him in Murder Boulevard! This street is L meters long, and currently William is at x=0, trying to reach his nest at x=L. Along this street there are N semaphores at positions X_i. All the traffic lights are synchronized: at t=0 the green triggers, and will stay green for T seconds; at t=T the red triggers, and will stay red for T seconds; and then the cycle repeats. William wants to reach his nest as quickly as possible, but he doesn't want to attract too much attention. Therefore, he travels at a constant speed of 1 meter per second (the speed limit), and he will stop and wait if he's at a red semaphore. Since he's very impatient, sometimes he may cross the red semaphore without waiting for the green, but he can do so at most R times. Which is the least amount of time William needs to reach his nest?