LearnPy Hub
← Arena
EasyRating 900

Take the Biggest

Take coins (largest first) until your sum is strictly greater than the sum of the coins left. Print how many coins you took.

Input

n, then n values.

Output

A count.

Sample 1

Input
2
3 3
Output
2

Sample 2

Input
3
2 1 2
Output
2
solution.py
Output appears here
Take the Biggest · Python Arena problem · LearnPy Hub