Number of Cattle
CodeChefOpen on judge ↗
Shirley’s parents own a farm and a barn. They always tell her to do chores like cleaning after the cattle or collect the eggs and such. Today they have told her to count the total animals in the barn. There are several chickens and cows in the barn (with no other types of animals). If there are “X” heads and “Y” feet inside the cage. How many chickens and cows are there? Constraints: 1 ≤ T ≤ 1
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