#abc204b. B - Nuts
B - Nuts
Score : points
问题描述
有 棵树。第 棵树结了 颗坚果。
花栗鼠将以以下方式采集坚果:
- 对于结有 颗或更少坚果的树,她不取走坚果。
- 对于结有多于 颗坚果的树,她会取走除了 颗以外的所有坚果。
请计算花栗鼠将从这些树上总共取走多少颗坚果。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are trees. The -th tree bears nuts.
Chipmunk will harvest nuts from the trees in the following manner:
- From a tree with or fewer nuts, she does not take nuts.
- From a tree with more than nuts, she takes all but nuts.
Find the total number of nuts Chipmunk will take from the trees.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
6 17 28
Sample Output 1
25
From the three trees, Chipmunk will take , , and nuts, for a total of nuts.
Sample Input 2
4
8 9 10 11
Sample Output 2
1
update @ 2024/3/10 09:17:00