You are given three integers n, m, and k, representing the lengths of two logs and the maximum log length that a truck can transport.
Each truck can carry at most one log of length at most k. If a log has a length strictly greater than k, it must be cut into smaller pieces such that every resulting piece has a length of at most k.
Dividing a log of length
Return the minimum total cost to cut the logs so that all pieces can be transported.
Constraints:
k
n, m k
The input is generated such that it is always possible to transport the logs.
You are given three integers n, m, and k, representing the lengths of two logs and the maximum log length that a truck can transport.
Each truck can carry at most one log of length at most k. If a log has a length strictly greater than k, it must be cut into smaller pieces such that every resulting piece has a length of at most k.
Dividing a log of length
Return the minimum total cost to cut the logs so that all pieces can be transported.
Constraints:
k
n, m k
The input is generated such that it is always possible to transport the logs.