← All problemsSign in

Which Chocolate to buy

Kaustav is a foodie kid. His father gave him N coins to buy a chocolate. At the shop, he is confused between chocolates $A$ and $B$. So, he decided to toss the coins where the probability of getting heads is $Pi$. Kaustav will buy chocolate A if the probability of having more heads than tails is greater than or equal to the probability of having more tails than heads. He will buy chocolate B if th

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