Practice Find Minimum Log Transportation Cost
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given integers n, m, and k. There are two logs of lengths n and m units, which need to be transported in three trucks where each truck can carry one log with length at most k units. You may cut the logs into smaller pieces, where the cost of cutting a log of length x into logs of length len1 and len2 is cost = len1 * len2 such that len1 + len2 = x. Return the minimum total cost to distribute the logs onto the trucks. If the logs don't need to be cut, the total cost is 0.
Source: Find Minimum Log Transportation Cost on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
n = 6, m = 5, k = 5
5
# Example 2
n = 4, m = 4, k = 6
0
Constraints
Related LeetCode Problems
Practice more problems similar to Find Minimum Log Transportation Cost.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.