With
1G, 2G, 3G, 5G, 10G, 20G
Some of the weights (total weight
<= 1000g
), Require: Input mode:
A1 A2 A3 A4 A5 A6 (
Indicate
1G
Weight
A1
A,
2G
Weight
A2
A,
...
20G weight has A6);
Output method: total = n (n means a number of different weights that can be referred to with these weights, but no need to extend a weight is not used);
Such as: Enter: 1 1 0 0 0 0
Output: Total = 3 indicates three different weights of 1G, 2G, 3G.