← All problemsSign in

Split and Maximize

CodeChefRating 1313Open on judge ↗

Let $f$ be a function, such that, for an array $A$ of size $M$, $f(A)$ is defined as $f(A) = \sum_{i=1}^{M}\sum_{j=1, j \ne i}^{j=M} (A_i\cdot A_j)$ You are given an array $C$ of size $N$. In one operation on the array, you can: - Choose an index $i$ $(1\le i \le |C|)$ - Select two **positive integers** $X$ and $Y$ such that $X+Y = C_i$ - **Remove** the element $C_i$ from the array $C$ - **Inser

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