시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 1024 MB | 39 | 6 | 6 | 23.077% |
All over Europe the F1-fever is burning stronger then ever after NextFlex released "Cars go vrooooom." Once you get in, there is no way out. The drama, the tactics, the drama, the racing, but most of all the drama.
This years series is one of the most exciting yet. The legendary battle between the two main stars Min Verstopen and Lery Slowington never fails to make a race entertaining. There are mind games, close battles and almost accidents all the way. But above all of this, the winner of a F1 race is the fastest driver, and the team with the best tactical decisions.
An above average committed fan named Dorothy has noticed that in our modern era of F1 there are numerous instruments on a F1 car, giving the teams data on how fast each car can race in different conditions. Dorothy believes one could use superior knowledge of algorithms to decide the best possible tactic given a set of race conditions. She has ran some statistics, and found that a car with $x$ round old tires uses $$r + b \cdot x$$ seconds on one lap where $r$ and $b$ are constants depending on the particular track.
Now she turns to you to provide her with an algorithm that finds the total race time for a team using optimal pitstops.
The input consists of four space-separated integers $n$, $p$, $r$ and $b$.
A single integer, the minimum number of seconds required to finish the race.
10 10 100 2
1044
Contest > Bergen Open > Bergen Open 2021 F번