#4304. At Most 3 (Judge ver.)
At Most 3 (Judge ver.)
At Most 3 (Judge ver.)
题目描述
There are weights called Weight , Weight , , Weight . Weight has a mass of .
Let us say a positive integer is a good integer if the following condition is satisfied:
We can choose at most different weights so that they have a total mass of .
How many positive integers less than or equal to are good integers?
输入格式
Input is given from Standard Input in the following format:
输出格式
Print the answer.
2 10
1 3
3
2 1
2 3
0
4 12
3 3 3 3
3
7 251
202 20 5 1 4 2 100
48
提示
All values in input are integers.If we choose only Weight , it has a total mass of , so is a good integer.
If we choose only Weight , it has a total mass of , so is a good integer.
If we choose Weights and , they have a total mass of , so is a good integer.
No other integer is a good integer. Also, all of , , and are integers less than or equal to . Therefore, the answer is .
There are no good integers less than or equal to .
There are good integers: , and .
For example, if we choose Weights , , and , they have a total mass of , so is a good integer.
Note that is not a good integer.
标签: AtCoder|abc251B
来源
AtCoder|abc251B