Cats and Dogs
Chef is a farmer and a pet lover. He has a lot of his favorite pets cats and dogs in the barn. He knows that there are $C$ cats and $D$ dogs in the barn. Also, one day went to field and found that there were $L$ legs of the animals touching the ground. Chef knows that cats love to ride on the dogs. So, they might ride on the dogs, and their legs won't touch the ground and Chef would miss counting
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