← All problemsSign in

Shuffling Parities

CodeChefRating 1347Open on judge ↗

Chef is given an array $A$ consisting of $N$ positive integers. Chef shuffles the array $A$ and creates a new array $B$ of length $N$, where $B_i = (A_i + i) \bmod 2$, for each $i\;(1 \leq i \leq N)$. Find the maximum possible sum of integers of the array $B$, if Chef shuffles the array $A$ optimally. ### Input - The first line of the input contains a single integer $T$ denoting the number of te

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