IntermediateRating 1100
Load the Truck
Box type i has count[i] boxes with units[i] units each. A truck carries at most T boxes. Print the most units it can carry.
Input
n T, then n lines 'count units'.
Output
A number.
Sample 1
Input
3 4 1 3 2 2 3 1
Output
8
Sample 2
Input
4 10 5 10 2 5 4 7 3 9
Output
91
Output appears here