← 返回 snowflake 的题目列表Minimum Total Weight
类型:online_judge
Given an array of n weights (weights[n]) where each weight represents the weight of a chocolate. Each day, you can pick one chocolate, consume half of its weight (floor the result) and keep the remaining weight. Calculate the minimum total weight of the chocolates after d days.
Input:
weights: An integer array representing the weight of the chocolates.
d: Number of days.
Output:
An integer representing the minimum total weight of chocolates after d days.
Example
Input
30 20 15 11
4