Manao is the coach of a soccer team. There are N boys numbered from 0 to N-1 on the team. Each of them has some level of soccer skill. Manao would like to divide the boys into two teams for today's training. The division should satisfy the following conditions:
Each boy is assigned to a team.
The total skill of first team is strictly greater than the total skill of the second team.
For each player P in the first team: if we were to move P into the second team, the total skill of the first team would become strictly smaller than the total skill of the second team.
The total skill of a team is the sum of skills of the boys on that team.
You are given a vector <int> skill containing N elements. The i-th element in skill is the skill of boy i. Manao is interested in the number of ways to perform such a division into teams. Please compute and return this number.
Definition
Class:
YetAnotherTwoTeamsProblem
Method:
count
Parameters:
vector <int>
Returns:
long long
Method signature:
long long count(vector <int> skill)
(be sure your method is public)
Limits
Time limit (s):
2.000
Memory limit (MB):
64
Constraints
-
skill will contain between 2 and 50 elements, inclusive.
-
Each element of skill will be between 1 and 60,000, inclusive.
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)2003, TopCoder, Inc. All rights reserved.