The original problem is in spanish, so I put it through google translate:
JBIRDS - Jeremiah and his parrots
no tags
Pirate Jeremiah plans to offer a show to his crew. To do this, Jeremiah has N parrots, which he plans to balance on his shoulders. Each of the N parrots has a weight, in grams, that Jeremiah knows in advance.
Jeremiah has only two shoulders, and therefore he must separate the parrots into two groups. The imbalance of Jeremiah will be equal to the (positive) difference in weight between the group on the left shoulder and the one on the right shoulder.
What is the least value that the pirate imbalance can take?
Input
The entry begins with a line that contains a single integer, N (0 <= N <= 10000)
The following N lines describe the weights of the parrots. Each line contains a single integer wi (0 <= wi <= 1000)
Output
A line with a single integer, the minimum imbalance (in absolute value).