Amplitude Hackathon Winter '25 Problem 4 - Golden Glizzy Gauntlet
View as PDFIt's time for the Golden Glizzy Gauntlet!
This year, Eric has assigned the participants to eat a total of
hot dogs. Each person has their own pace at which they can eat one hot dog.
Each person starts eating a hot dog at the same time and when someone finishes, they immediately start eating another hot dog. Fractional hot dogs do not count.
How long will it take them to eat the assigned number of hot dogs?
Constraints
Subtask 1 [1 point]
Subtask 2 [1 point]
No additional constraints.
Input Specification
The first line contains two integers, and
.
The next line contains integers, each one being the number of seconds to eat one hot dog for one of the
participants.
Output Specification
Output a single integer, the amount of time needed for the participants to eat hot dogs in seconds.
Sample Input 1
2 3
6 7
Sample Output 1
12
Sample Explanation 1
In 12 seconds, the first person eats two hot dogs and the second person eats one hot dog.
Comments