Didn't quite understand this problem.
Should all sticks be used?
In the first sample input, 1 6 2
Does it mean "2 3 3 3 3 3 3 5 5" cm sticks?
I found
3 3 2
5 5 3
5 5 2
3 3 5, 4 possible combinations.
Why the answer is 3?
Thanks.
13039 - Fibonacci Triangle
13039 - Fibonacci Triangle
Life shouldn't be null.
Re: 13039 - Fibonacci Triangle
OK, I figured it out, and I'll explain a little bit more in details.
1. For input "1 6 2", we have sticks of lengths of "2 3 3 3 3 3 3 5 5", 9 sticks in total.
2. We have to make as many triangles as possible.
3. Each triangle consists of 3 sticks, and no stick should be used more than once.
So for the sample input, we can form 3 triangles in the following way:
2 3 3
3 3 5
3 3 5
using all sticks and we form 3.
Other combinations may also exist, and some sticks may never be used.
1. For input "1 6 2", we have sticks of lengths of "2 3 3 3 3 3 3 5 5", 9 sticks in total.
2. We have to make as many triangles as possible.
3. Each triangle consists of 3 sticks, and no stick should be used more than once.
So for the sample input, we can form 3 triangles in the following way:
2 3 3
3 3 5
3 3 5
using all sticks and we form 3.
Other combinations may also exist, and some sticks may never be used.
Life shouldn't be null.