using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication1
{
    class Animal
    {
        public long Count; // количество животных данного вида
        double KDead; //естественная убыль
        double KBorn; // рождаемость
        double KEatMeal; //аппетит сколько ест одно животное
        /// <summary>
        /// Это конструктор класса!!!
        /// </summary>
        /// <param name="c"></param>
        /// <param name="KDead"></param>
        /// <param name="KBorn"></param>
        /// <param name="KEatMeal"></param>
        public Animal(int c, double KDead, double KBorn, double KEatMeal)
        {
            Count=c;
            this.KDead=KDead;
            this.KBorn=KBorn;
            this.KEatMeal=KEatMeal;
        }
        public void Born()
        {
            Count += Convert.ToInt16(Count*KBorn);
        }
        public void Dead()
        {
            Count -= Convert.ToInt16(Count * KDead);
            if (Count <= 0) Count = 0;
        }
        public long Eat(long Food)
        {
            int CanEat = Convert.ToInt16(Count*KEatMeal);
            if (Food >= CanEat)
            {
                Food -= CanEat;
            }
            else
            {
                Count = Convert.ToInt16(Food / KEatMeal);
                Food = 0;
            }
            return Food;
        }
        public override String ToString()
        {
            String str = "";
            str = "Animal count: " + Count.ToString() +
                "KD: " + KDead.ToString() +
                "KB: " + KBorn.ToString() +
                "KE: " + KEatMeal.ToString();
            return str;
        }
    }
}
