Cat's Age
Time limit1sMemory limit1024 MB
Given a cat's age in years and months, convert it to human age in years and months using the 15, 9, and 4 rule.
- Level
Easy2 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
There are several proposals for converting a cat's age to human age. One such approach works as follows:
- The first year of a cat's age is equivalent to 15 years of human age.
- The second year of a cat's age is equivalent to 9 years of human age.
- Every year after the second year of a cat's age is equivalent to 4 years of human age.
For example, if a cat is 13 years old, the cat is years old in human age. Note that this approach implies:
- If a cat is less than one year old, each month of the cat's age is equivalent to 15 months of human age. For example, a 5-month-old cat is months old in human age, which is 6 years and 3 months.
- If a cat is older than one year but less than two years old, each month after the first year is equivalent to 9 months of human age. For example, a cat that is 1 year and 7 months old is years and 3 months old in human age.
- If a cat is older than two years, each month after the second year is equivalent to 4 months of human age. For example, a cat that is 5 years and 7 months old is years and 4 months old in human age.
Input
There is only one input line containing two integers: (), the year part of the cat's age, and (), the month part of the cat's age.
Output
Print two integers: the cat's age in human age, given as years and months. The month value must not exceed 11.