A farmer wants to plant a row of trees along the front of his house. He has two different kinds of trees, some which are plain looking, and other, more expensive, fancy trees. He wishes to plant the trees in such a way that not all of the fancy trees are grouped together, so he insists that no two fancy trees be adjacent to one another.
You are given an int total indicating the total number of trees to be planted, and an int fancy which is the number of fancy trees. You are to return a long indicating the number of possible tree arrangements that meet the farmer's criteria of having no two fancy trees adjacent to one another.
|