← All problemsSign in

Funny Hand

CodeChefRating 1306Open on judge ↗

MoEngage has $3$ decks. Each deck consists of $N$ cards, numbered from $1$ to $N$. He draws out $1$ card from each deck randomly with each card having an equal probability of being drawn. MoEngage drew cards numbered $A$ and $B$ from the decks $1$ and $2$ respectively. Now, he wonders what is the probability that he will end up with a *funny hand* after drawing the third card. A *funny hand* is

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