← All problemsSign in

Starved for Seating

CodeChefRating 983Open on judge ↗

You're the manager of a football stadium, and it's now time to decide whether to upgrade it or not. There are $N$ football teams. You know that the $i$-th team has $A_i$ fans. Each person is a fan of exactly one team, so the total number of people is $(A_1 + \ldots + A_N)$. It is guaranteed that each $A_i$ is an **even integer**. When a match between teams $X$ and $Y$ ($X \ne Y$) happens in t

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start