← All problemsSign in

Two Averages

CodeChefRating 2353Open on judge ↗

Chef has an array $A$ of size $N$ such that $1 \le A_i \le K$ for all $1 \le i \le N$. $\\$ Chef also has another array $B$ of size $M$ such that $1 \le B_i \le K$ for all $1 \le i \le M$ Chef can perform the following operation: $\\$ **1)** Select an integer $X$ such that $1 \le X \le K$ $\\$ **2)** Append $X$ to the end of exactly one array among $A$ and $B$ Find the **minimum** number of oper

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