Comments

Maybe it isn't a good idea, but i can't see editorial for this problems :(

Screenshot

As I understood, and as I finally get "Full solution": For exmaple, we have

3
110 80 170

(Answer 20) We should take different variants of pieces:

110
110 80
110 80 170
80
80 170
170

And for each variant, we calculate sum and compare with the minimum: if (min < sum-(360-sum)) min = sum-(360-sum)

Tried to explain my solution on my bad english :D

Ahhh, I see. Thanks :)

Test 8 picture

Can anyone explain, why in Problem A on the test 8:

5
110 90 70 50 40

The answer is 40? We can take 90 40 50 and 110 70 — 180 and 180, so the answer is 0, isn't it? Or did I misunderstand it?

On Kniaz → Codeforces Round #392 (Div. 2), 10 years ago
+6

On Arpa → Codeforces Round #383, 10 years ago
-13

I can solve only first problem for 2 hours and i'm green, so you need to solve only first problem and you become green:)