Problem
There are N trees in an orchard. Each tree has some apples on it.
You can pick at most K apples from each tree. If a tree has fewer than K apples, take all of them.
What is the total number of apples you collect?
You can pick at most K apples from each tree. If a tree has fewer than K apples, take all of them.
What is the total number of apples you collect?
Input Variables (pre-loaded)
💡 Drag N, K, and apples at tree i from the Inputs category.
Your Output
Result
—
Run your program to see the result.
Execution Log
Ready. Press ▶ Run to start.
Expected Answer
Answer:
?
Hint
Step 0