Chickens and Rabbits

  1. Let us consider the famous Chichens-and-Rabbits (雞兔同籠) problem.
  2. Suppose there are multiple chickens and rabbits in a cage. We only know the total number of heads and total number of legs, and we want to find out the exact number of chickens and rabbits, respectively.
    [Chicken [Rabbit]
  3. Write a Python program to calculate this.
  4. PS: You may assume that the input values are always valid in this exercise. In Chapter 7, we shall learn how to judge whether input data are valid.

Your program may run as follows:

Head? 72
Leg? 200
There are 44 chickens and 28 rabbits.