#GD0000007. Cặp song sinh (Twins)
Cặp song sinh (Twins)
Twins
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
There are coins with values . Choose the minimum number of coins such that their total value is strictly greater than the total value of all remaining coins.
Input
The first line contains . The second line contains integers .
Output
Print the minimum number of coins to take.
Subtasks
General constraints:
-
.
-
.
-
Subtask 1 (20 points):
-
Subtask 2 (30 points):
-
Subtask 3 (50 points): No additional constraints.
Examples
Input
3
2 1 2
Output
2
Explanation
Taking the two coins of value gives total , strictly larger than the remaining total . One coin is insufficient.