PROBLEM STATEMENT
John and Brus have an interest in team sports tournaments.
They are currently investigating a basketball tournament.
Basketball is a team sport in which two teams of five players try to score points against one
another by placing a ball through a ten foot high hoop.
Basketball is one of the most popular and widely viewed sports in the world.
There are n teams in the tournament. Each pair of teams plays exactly two games against each
other. Each game results in one team winning. There are no draws.
After the tournament is over, the team with the highest total number of wins takes 1st place, the
team with the second highest number of wins takes 2nd place, and so on.
A sequence of integers W1, W2, ..., Wn is called a W-sequence if there exists a tournament where
the team that took i-th place has exactly Wi total wins (for all i between 1 and n, inclusive).
Given ints n and m, return the number of W-sequences consisting of n integers where W1 = m.
DEFINITION
Class:TheBasketballDivOne
Method:find
Parameters:int, int
Returns:int
Method signature:int find(int n, int m)
CONSTRAINTS
-n will be between 2 and 5, inclusive.
-m will be between 1 and 9, inclusive.
EXAMPLES
0)
2
1
Returns: 1
The only possible W-sequence is (1, 1).
1)
3
1
Returns: 0
There is no valid outcome where the winning team has just one win.
2)
3
3
Returns: 2
The two possible sequences are (3, 2, 1) and (3, 3, 0).
3)
4
6
Returns: 5
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.