DAPC24-045.Joppiesaus Jailbreak
Medium · 2 s · 256 MB
- icpc
- dapc
- 2024
You have recently decided to pick up speedrunning the video game Bario: A Plumber's Cousin. In this 2D platforming console classic, you play as Bario, an Italian electrician travelling the world to find his long lost cousin. The game consists of a number of side-scrolling levels with a bus at the end that takes Bario to the next level. Unfortunately, years of optimizations have led to a world record that is currently tied between hundreds of speedrunners and you feel like matching the world record at this point is no longer that big of an achievement. Instead, you try to beat the tied world record by any means necessary.
At first, this seems impossible: Bario has a maximum right speed of pixels per second, and the current strategies already hold this speed through the entire level. However, completing a level always takes an integer number of frames. If Bario reaches the bus halfway through a frame, the game still has to wait for the frame to complete before starting the next level. Normally, this does not influence speedrunning, as each console runs the game at the same, constant frame rate . That is, unless you apply a specific condiment mix to the game disk. You would prefer not to go into detail as to how you know this, but applying a specific mix of mayonnaise and curry spices (more commonly known as the Dutch specialty Joppiesaus) to the game disk allows you to set the frame rate of the game to any positive real number. This new frame rate cannot exceed the original frame rate and remains constant for the entire game. Using your new strategy, what is the fastest time in which you can finish the game? The timing stops when the final frame ends.
For example, consider the third sample input. By modifying the game to run at frames per second, both levels complete in frames, or seconds. The total time of seconds beats the current world record of seconds at the original frames per second.
Giriş formatı
The input consists of:
• One line with two integers and (, ), the number of levels and the original frame rate of the game in frames per second.
• One line with integers (), the length of each level in pixels. The total length of all levels does not exceed pixels.
Çıxış formatı
Output the fastest time, in seconds, in which you can finish the game.
Your answer should have an absolute or relative error of at most .
Qeyd
Source: Delft Algorithm Programming Contest 2024 · Author: Mike de Vries · License: CC BY-SA 4.0 · Original: https://dapc.wisv.ch · Statement adapted for AlgoLens and shared under the same license. · 50 of the 170 original test cases (the largest) are omitted here to keep the problem lightweight.
Nümunələr
Giriş #1
1 10 1234
Çıxış #1
1.234
Giriş #2
1 10 12
Çıxış #2
0.1
Giriş #3
2 10 6245 6212
Çıxış #3
12.49
Giriş #4
2 20 6245 6212
Çıxış #4
12.47409677
Giriş #5
3 50 7146 2657 8164
Çıxış #5
17.96910941