# NEO01 - Editorial

Author: Sameer Gulati
Tester: Prateek Gupta
Editorialist: Oleksandr Kulkov

simple

None

### PROBLEM:

You are given set of integers. You have to split it into subsets in such way that \sum\limits_{subsets}|subset_i| \times\left(\sum\limits_{j\in subset_i}a_j\right) is maximized.

### EXPLANATION:

Since we want to maximize multiplier of positive elements, they all should be in the same subset. Also we can take with them some largest of negative elements.

Since we want to minimize the multiplier of negative elements, each of remaining negative elements will be in the set containing only this element (i.e. single element sets).

Thus we bruteforce the number of negative elements which will be in the set with positive ones and choose the best possible sum among all this variants.

### AUTHOR’S AND TESTER’S SOLUTIONS:

Author’s solution will be updated soon.
Tester’s solution will be updated soon.
Editorialist’s solution will be updated soon.

### RELATED PROBLEMS:

See this test case:
n=8
-5 -3 -2 0 0 2 8 12
Answer = 114 . But as most people have done their answer would come 112 and still would pass.

could u explain how it is 114?
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}