This page is still under construction.

Parts of this page are still being built. What you see may change.

Cat's Age

Time limit1sMemory limit1024 MB

Summary
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:

  1. The first year of a cat's age is equivalent to 15 years of human age.
  2. The second year of a cat's age is equivalent to 9 years of human age.
  3. 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 (15)+(9)+[(13−2)×4]=68(15) + (9) + [(13 - 2) \times 4] = 68 years old in human age. Note that this approach implies:

  1. 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 5×15=755 \times 15 = 75 months old in human age, which is 6 years and 3 months.
  2. 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 15 years+(7×9) months=15 years+63 months=2015 \text{ years} + (7 \times 9) \text{ months} = 15 \text{ years} + 63 \text{ months} = 20 years and 3 months old in human age.
  3. 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 15 years+9 years+(5−2)×4 years+(7×4) months=3815 \text{ years} + 9 \text{ years} + (5 - 2) \times 4 \text{ years} + (7 \times 4) \text{ months} = 38 years and 4 months old in human age.

Input

There is only one input line containing two integers: yy (0≤y≤200 \le y \le 20), the year part of the cat's age, and mm (0≤m≤110 \le m \le 11), 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.

Examples5

  1. Example 1

    Input
    13 0
    
    Expected output
    68 0
    
  2. Example 2

    Input
    0 5
    
    Expected output
    6 3
    
  3. Example 3

    Input
    1 7
    
    Expected output
    20 3
    
  4. Example 4

    Input
    5 7
    
    Expected output
    38 4
    
  5. Example 5

    Input
    20 11
    
    Expected output
    99 8