← All problemsSign in

Butterfly

CodeChefRating 824Open on judge ↗

In your garden, there are exactly $R$ red butterflies, $G$ green butterflies and $B$ blue butterflies. There are also exactly $R$ red flowers, $G$ green flowers and $B$ blue flowers. Determine whether it is possible for every butterfly to feed on exactly one flower, such that: - No two butterflies feed on the same flower; and - Each butterfly feeds on a flower whose color is **different** from

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