PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000007. Cặp song sinh (Twins)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Cặp song sinh (Twins)

Twins

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn coins with values aia_i. 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 nn. The second line contains nn integers aia_i.

Output

Print the minimum number of coins to take.

Subtasks

General constraints:

  • 1≤n≤1001 \le n \le 100.

  • 1≤ai≤1001 \le a_i \le 100.

  • Subtask 1 (20 points): n≤10n \le 10

  • Subtask 2 (30 points): n≤50n \le 50

  • Subtask 3 (50 points): No additional constraints.

Examples

Input

3
2 1 2

Output

2

Explanation

Taking the two coins of value 22 gives total 44, strictly larger than the remaining total 11. One coin is insufficient.