This problem is a Mooshak version of a CSES problem.
A factory has
For each machine, you know the number of seconds it needs to make a single product. The machines can work simultaneously, and you can freely decide their schedule.
What is the shortest time needed to make
The first input line has two integers
The next line has nn integers
Print a line one integer: the minimum time needed to make
Example Input | Example Output |
3 7 3 2 5 |
8 |
Explanation: Machine 1 makes two products, machine 2 makes four products and machine 3 makes one product.