← All problemsSign in

Layered Cake

CodeChefRating 875Open on judge ↗

Chef is making a layered cake consisting of $2$ layers. Chef has $N$ options for the first layer, represented by an array $A = [A_1, A_2, \ldots, A_N]$, where $A_i$ represents the size of the $i$-th first layer of the cake. Similarly, Chef has $M$ options for the second layer, represented by an array $B = [B_1, B_2, \ldots, B_M]$, where $B_i$ represents the size of the $i$-th second layer of the

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