Pretty Beaded Chain
CodeChefOpen on judge ↗
Ginny had $R$ **red** beads and $B$ **blue** beads and she wanted to stick them side by side to make a long **straight chain** of beads. However, the red beads were only sticking to the blue beads and the blue beads were only sticking to the red beads. Can you help her to make the **longest** chain possible and print the total **number** of beads that could be present in it? ### Input - There w
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.
Sign in to chat with the tutor and save your progress.
Sign in to start