# Kata Task

I have a cat and a dog.

I got them at the same time as kitten/puppy. That was `humanYears` years ago.

Return their respective ages now as [`humanYears`,`catYears`,`dogYears`]

NOTES:
* humanYears >= 1
* humanYears are whole numbers only

## Cat Years

* `15` cat years for first year
* `+9` cat years for second year
* `+4` cat years for each year after that

## Dog Years

* `15` dog years for first year
* `+9` dog years for second year
* `+5` dog years for each year after that



**References**

* http://www.catster.com/cats-101/calculate-cat-age-in-cat-years
* http://www.slate.com/articles/news_and_politics/explainer/2009/05/a_dogs_life.html



If you liked this Kata there is another related one here

Difficulty: EASY
Tags: Fundamentals

Starter code:
def human_years_cat_years_dog_years(human_years):
	

Solutions:
def human_years_cat_years_dog_years(x):
	return [x, 24 + (x - 2) * 4 if x != 1 else 15, 24 + (x - 2) * 5 if x != 1 else 15]


def human_years_cat_years_dog_years(human_years):
	catYears = 0
	dogYears = 0
	if human_years == 1:
		catYears += 15
		dogYears += 15
		return [human_years, catYears, dogYears]
	elif human_years == 2:
		catYears += 24
		dogYears += 24
		return [human_years, catYears, dogYears]
	elif human_years > 2:
		catYears += 24
		dogYears += 24
		years = human_years - 2
		catYears += years * 4
		dogYears += years * 5
		return [human_years, catYears, dogYears]
	return [0, 0, 0]


def human_years_cat_years_dog_years(n):
	cat_years = 15 + 9 * (n > 1) + 4 * (n - 2) * (n > 2)
	dog_years = 15 + 9 * (n > 1) + 5 * (n - 2) * (n > 2)
	return [n, cat_years, dog_years]


def human_years_cat_years_dog_years(hy):
	return [hy, 16 + 4 * hy, 14 + 5 * hy] if hy > 1 else [1, 15, 15]


def human_years_cat_years_dog_years(human_years, dog_years=15, cat_years=15):
	if human_years == 1:
		pass
	elif human_years == 2:
		cat_years = dog_years = 24
	else:
		cat_years = 4 * human_years + 16
		dog_years = 5 * human_years + 14
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(h):
	(c, d) = (0, 0)
	if h == 1:
		(c, d) = (15, 15)
	elif h >= 2:
		(c, d) = (24, 24)
	for i in range(h - 2, 0, -1):
		c += 4
		d += 5
	return [h, c, d]


def human_years_cat_years_dog_years(human_years):
	catYears = 15
	DogYears = 15
	if human_years == 1:
		return [human_years, catYears, DogYears]
	elif human_years == 2:
		return [human_years, catYears + 9, DogYears + 9]
	elif human_years >= 3:
		n = human_years - 3
		s = 24 + n * 4 + 4
		f = 24 + n * 5 + 5
		return [human_years, s, f]


def human_years_cat_years_dog_years(human_years):
	if human_years > 2:
		cat_years = (human_years - 2) * 4 + 24
		dog_years = (human_years - 2) * 5 + 24
	elif human_years == 2:
		cat_years = 24
		dog_years = 24
	else:
		cat_years = 15
		dog_years = 15
	return [human_years, cat_years, dog_years]


human_years_cat_years_dog_years = lambda h: [h] + [15 * (h >= 1) + 9 * (h >= 2) + (h - 2) * y * (h > 2) for y in [4, 5]]


def human_years_cat_years_dog_years(h):
	return [h, 15 + 9 * (h >= 2) + 4 * max(h - 2, 0), 15 + 9 * (h >= 2) + 5 * max(h - 2, 0)]


def human_years_cat_years_dog_years(years):
	return [years, 16 + 4 * years, 14 + 5 * years] if years > 1 else [1, 15, 15]


def human_years_cat_years_dog_years(human_years):
	catYears = 0
	dogYears = 0
	if human_years < 2:
		catYears = human_years * 15
		dogYears = catYears
	elif human_years < 3:
		catYears = 15 + 9
		dogYears = catYears
	else:
		catYears = (human_years - 2) * 4 + 24
		dogYears = (human_years - 2) * 5 + 24
	return [human_years, catYears, dogYears]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		return [1, 15, 15]
	years_after_2nd = human_years - 2
	cat_years = 24 + 4 * years_after_2nd
	dog_years = 24 + 5 * years_after_2nd
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	CAT_YEARS_FIRST = 14
	DOG_YEARS_FIRST = 14
	CAT_YEARS_SECOND = 8
	DOG_YEARS_SECOND = 8
	CAT_YEARS_THIRD = 4
	DOG_YEARS_THIRD = 5
	if human_years == 1:
		return [human_years, human_years + CAT_YEARS_FIRST, human_years + DOG_YEARS_FIRST]
	elif human_years == 2:
		return [human_years, human_years + CAT_YEARS_FIRST + CAT_YEARS_SECOND, human_years + DOG_YEARS_FIRST + DOG_YEARS_SECOND]
	else:
		return [human_years, CAT_YEARS_FIRST + CAT_YEARS_SECOND + CAT_YEARS_THIRD * (human_years - 2) + 2, DOG_YEARS_FIRST + DOG_YEARS_SECOND + DOG_YEARS_THIRD * (human_years - 2) + 2]


from functools import partial

def human_years_cat_years_dog_years(human_years):
	return [age_func(human_years) for age_func in (human_age, cat_age, dog_age)]

def critter_age(human_years, critter_years_multipliers):
	critter_age = previous_year = 0
	for (year, multiplier) in critter_years_multipliers:
		is_older = human_years > year
		years_difference = (year if is_older else human_years) - previous_year
		critter_age += multiplier * years_difference
		if not is_older:
			break
		previous_year = year
	return critter_age
infinity = float('inf')
human_age = partial(critter_age, critter_years_multipliers=((infinity, 1),))
cat_age = partial(critter_age, critter_years_multipliers=((1, 15), (2, 9), (infinity, 4)))
dog_age = partial(critter_age, critter_years_multipliers=((1, 15), (2, 9), (infinity, 5)))


def human_years_cat_years_dog_years(human_years):
	ages = [0, 0, 0]
	if human_years == 1:
		ages[0] = 1
		ages[1] = 15
		ages[2] = 15
	if human_years == 2:
		ages[0] = 2
		ages[1] = 24
		ages[2] = 24
	if human_years >= 3:
		ages[0] = human_years
		ages[1] = 24 + (human_years - 2) * 4
		ages[2] = 24 + (human_years - 2) * 5
	return ages


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		return [1, 15, 15]
	if human_years == 2:
		return [2, 24, 24]
	return [human_years, (human_years - 2) * 4 + 24, (human_years - 2) * 5 + 24]


def human_years_cat_years_dog_years(human_years):
	cat_years = 15 if human_years == 1 else 15 + 9 if human_years == 2 else 15 + 9 + (human_years - 2) * 4
	dog_years = 15 if human_years == 1 else 15 + 9 if human_years == 2 else 15 + 9 + (human_years - 2) * 5
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	a = 15 + 9 * int(human_years >> 1 != 0)
	return [human_years, a + 4 * max(0, human_years - 2), a + 5 * max(0, human_years - 2)]


def human_years_cat_years_dog_years(human_years):
	cat_years = (lambda y: 15 + 9 * (0, 1)[y - 1 > 0] + 4 * (y - 2) * (0, 1)[y - 2 > 0])(human_years)
	dog_years = (lambda y: 15 + 9 * (0, 1)[y - 1 > 0] + 5 * (y - 2) * (0, 1)[y - 2 > 0])(human_years)
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(n):
	return [n, 15 if n == 1 else 4 * (n + 4), 15 if n == 1 else 5 * n + 14]


from functools import partial
infinity = float('inf')

def human_years_cat_years_dog_years(human_years):
	age = Age.from_human(human_years)
	return [age.as_human, age.as_cat, age.as_dog]

class AgeConversionsMeta(type):

	def __new__(meta, name, bases, namespace):
		attr_name = namespace.pop('_attr_name_', 'normalized_age')
		conversions = namespace.pop('_conversions_', {})
		if conversions:

			def as_(self, year_to_multiplier):
				age = getattr(self, attr_name)
				converted_age = previous_year = 0
				for (year, multiplier) in year_to_multiplier:
					is_older = age > year
					years_difference = (year if is_older else age) - previous_year
					converted_age += multiplier * years_difference
					if not is_older:
						break
					previous_year = year
				return converted_age
			for (name, year_to_multiplier) in conversions.items():
				namespace['from_' + name] = classmethod(partial(meta.__from, year_to_multiplier=year_to_multiplier))
				namespace['as_' + name] = property(partial(as_, year_to_multiplier=year_to_multiplier))

		def __init__(self, normalized_age):
			setattr(self, attr_name, normalized_age)
		namespace['__init__'] = __init__
		return super().__new__(meta, name, bases, namespace)

	def __from(cls, age, year_to_multiplier):
		normalized_age = previous_year = 0
		for (year, multiplier) in year_to_multiplier:
			years_difference = year - previous_year
			max_age_in_range = multiplier * years_difference
			if age <= max_age_in_range:
				normalized_age += age / multiplier
				break
			age -= max_age_in_range
			previous_year = year
			normalized_age += years_difference
		return cls(normalized_age)

class Age(metaclass=AgeConversionsMeta):
	_conversions_ = {'human': ((infinity, 1),), 'cat': ((1, 15), (2, 9), (infinity, 4)), 'dog': ((1, 15), (2, 9), (infinity, 5))}


def human_years_cat_years_dog_years(hy):
	cy = 15 + (hy > 1) * (4 * hy + 1)
	dy = 15 + (hy > 1) * (5 * hy - 1)
	return [hy, cy, dy]


def human_years_cat_years_dog_years(human_years):
	cat = sum([15, 9, (human_years - 2) * 4][:human_years])
	dog = sum([15, 9, (human_years - 2) * 5][:human_years])
	return [human_years, cat, dog]


human_years_cat_years_dog_years = lambda n: [n] + [15 * (n > 0) + 9 * (n > 1) + d * max(0, n - 2) for d in (4, 5)]


human_years_cat_years_dog_years = lambda h: [1, 15, 15] if h == 1 else [2, 24, 24] if h == 2 else [h, 24 + 4 * (h - 2), 24 + 5 * (h - 2)]


def human_years_cat_years_dog_years(human_years):
	(cat_years, dog_years) = (0, 0)
	if human_years > 1:
		cat_years = 24 + (human_years - 2) * 4
		dog_years = 24 + (human_years - 2) * 5
	else:
		cat_years = dog_years = 15
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(y):
	return [y, 24 + 4 * (y - 2), 24 + 5 * (y - 2)] if y >= 2 else [y, y * 9 + 6, y * 9 + 6]


YRS = (15, 15 + 9, (4, 5))

def human_years_cat_years_dog_years(human_years):
	return [human_years, *({0: YRS[0]}.get(human_years - 1, k * (human_years - 2) + YRS[1]) for k in YRS[-1])]


def human_years_cat_years_dog_years(human_years):
	return [human_years, *(dict(enumerate((15, 24))).get(human_years - 1, k * (human_years - 2) + 24) for k in (4, 5))]


def human_years_cat_years_dog_years(y):
	return [y, 16 + 4 * y, 14 + 5 * y] if y > 1 else [1, 15, 15]


def human_years_cat_years_dog_years(h):
	cat = sum([15 if x == 0 else 9 if x == 1 else 4 for x in range(h)])
	return [h, cat, cat + h - 2 if h > 2 else cat]


def human_years_cat_years_dog_years(h):
	l = list(range(1, h + 1))
	return [h, 15 * len(l[0:1]) + 9 * len(l[1:2]) + 4 * len(l[2:]), 15 * len(l[0:1]) + 9 * len(l[1:2]) + 5 * len(l[2:])]


def human_years_cat_years_dog_years(human_years):
	catYears = 15
	if human_years == 2:
		catYears = 15 + 9
	if human_years >= 3:
		catYears = 24 + (human_years - 2) * 4
	dogYears = 15
	if human_years == 2:
		dogYears = 15 + 9
	if human_years >= 3:
		dogYears = 24 + (human_years - 2) * 5
	return [human_years, catYears, dogYears]


def human_years_cat_years_dog_years(human_years):
	return [human_years, sum([15 if x == 1 else 9 if x == 2 else 4 for x in range(1, human_years + 1)]), sum([15 if x == 1 else 9 if x == 2 else 5 for x in range(1, human_years + 1)])]


from typing import List

def human_years_cat_years_dog_years(human_years: int) -> List[int]:
	__get_animals_years_multiplier = lambda _def: [{1: 15, 2: 9}.get(_it, _def) for _it in list(range(1, human_years + 1))]
	return [human_years, sum(__get_animals_years_multiplier(4)), sum(__get_animals_years_multiplier(5))]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		dog = 15
		cat = 15
	elif human_years == 2:
		dog = 24
		cat = 24
	else:
		dog = 24 + int(human_years - 2) * 5
		cat = 24 + int(human_years - 2) * 4
	return [human_years, cat, dog]


def human_years_cat_years_dog_years(human_years):
	cat_years = 0
	for i in range(1, human_years + 1):
		cat_years += {1: 15, 2: 9}.get(i, 4)
		print(i)
	return [human_years, cat_years, cat_years + (human_years - 2 if human_years > 1 else 0)]


def human_years_cat_years_dog_years(human_years):
	if human_years >= 1:
		cat_years = 15
		dog_years = 15
	if human_years >= 2:
		cat_years += 9
		dog_years += 9
		for i in range(human_years - 2):
			cat_years += 4
			dog_years += 5
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	cat_years = 15 + 9 * (human_years >= 2) + 4 * (human_years - 2) * (human_years >= 3)
	dog_years = 15 + 9 * (human_years >= 2) + 5 * (human_years - 2) * (human_years >= 3)
	return [human_years, cat_years, dog_years]


human_years_cat_years_dog_years = lambda y: [y, y * 4 + (16 if y > 1 else 11 if y == 1 else 0), y * 5 + (14 if y > 1 else 10 if y == 1 else 0)]


def human_years_cat_years_dog_years(human_years):
	if human_years >= 2:
		catYears = 15 + 9 + (human_years - 2) * 4
		dogYears = 15 + 9 + (human_years - 2) * 5
		return [human_years, catYears, dogYears]
	else:
		return [human_years, 15, 15]


def human_years_cat_years_dog_years(human_years):
	catYears = 0
	dogYears = 0
	humanYears = human_years
	for i in range(human_years):
		if i == 0:
			catYears = catYears + 15
			dogYears = dogYears + 15
		if i == 1:
			catYears = catYears + 9
			dogYears = dogYears + 9
		if i > 1:
			catYears = catYears + 4
			dogYears = dogYears + 5
	return [humanYears, catYears, dogYears]


def human_years_cat_years_dog_years(human_years):
	c = 15
	d = 15
	if human_years == 2:
		c = 15 + 9
		d = 15 + 9
	if human_years > 2:
		c = 24 + (human_years - 2) * 4
		d = 24 + (human_years - 2) * 5
	return [human_years, c, d]


def human_years_cat_years_dog_years(hy):
	return [hy, 15 if hy == 1 else 24 if hy == 2 else 24 + (hy - 2) * 4, 15 if hy == 1 else 24 if hy == 2 else 24 + (hy - 2) * 5]


def human_years_cat_years_dog_years(human_years):
	animal_first_two_years = 15 if human_years > 0 else 0
	animal_first_two_years += 9 if human_years > 1 else 0
	animal_last_years = max(0, human_years - 2)
	return [human_years, animal_first_two_years + 4 * animal_last_years, animal_first_two_years + 5 * animal_last_years]


def human_years_cat_years_dog_years(human_years):
	b = 0
	c = 0
	if human_years == 1:
		b = 15
		c = 15
	elif human_years == 2:
		b = 24
		c = 24
	else:
		b = 24 + (human_years - 2) * 4
		c = 24 + (human_years - 2) * 5
	return [human_years, b, c]


def human_years_cat_years_dog_years(human_years):
	dog_years = 15 + min(human_years - 1, 1) * 9 + max(human_years - 2, 0) * 5
	cat_years = 15 + min(human_years - 1, 1) * 9 + max(human_years - 2, 0) * 4
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(hy):
	if hy == 1:
		return [1, 15, 15]
	elif hy == 2:
		return [2, 24, 24]
	elif hy > 2:
		return [hy, 24 + 4 * (hy - 2), 24 + 5 * (hy - 2)]
	return [0, 0, 0]


def human_years_cat_years_dog_years(human):
	if human == 1:
		return [human, 15, 15]
	if human == 2:
		return [human, 24, 24]
	if human >= 3:
		return [human, (human - 2) * 4 + 24, (human - 2) * 5 + 24]


def human_years_cat_years_dog_years(human):
	cat = 0
	dog = 0
	if human >= 1:
		cat += 15
		dog += 15
	if human >= 2:
		cat += 9
		dog += 9
	if human >= 3:
		n = human - 2
		cat += n * 4
		dog += n * 5
	return [human, cat, dog]


def human_years_cat_years_dog_years(hy):
	base = 15 * (hy >= 1) + 9 * (hy >= 2)
	rest = max(0, hy - 2)
	cy = base + 4 * rest
	dy = base + 5 * rest
	return [hy, cy, dy]


def human_years_cat_years_dog_years(h):
	if h == 1:
		return [h, 15, 15]
	if h == 2:
		return [h, 24, 24]
	return [h, 24 + (h - 2) * 4, 24 + (h - 2) * 5]


from itertools import accumulate, repeat

def human_years_cat_years_dog_years(years):
	if years >= 2:
		return [years, 4 * (years - 2) + 24, 5 * (years - 2) + 24]
	elif years == 1:
		return [1, 15, 15]


def human_years_cat_years_dog_years(human_years):
	cat_years = 0
	dog_years = 0
	for y in range(0, human_years):
		if y == 0:
			cat_years += 15
			dog_years += 15
		elif y == 1:
			cat_years += 9
			dog_years += 9
		else:
			cat_years += 4
			dog_years += 5
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	cat_years = 0
	dog_years = 0
	if human_years < 2:
		cat_years += 15
		dog_years += 15
	elif human_years == 2:
		cat_years += 15 + 9
		dog_years += 15 + 9
	else:
		cat_years += 15 + 9 + (human_years - 2) * 4
		dog_years += 15 + 9 + (human_years - 2) * 5
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		return [1, 15, 15]
	elif human_years == 2:
		return [2, 24, 24]
	else:
		return [human_years, (human_years - 2) * 4 + 24, (human_years - 2) * 5 + 24]
	32


def human_years_cat_years_dog_years(h):
	(cat, dog) = (0, 0)
	if h >= 1:
		cat += 15
		dog += 15
	if h >= 2:
		cat += 9
		dog += 9
	if h >= 3:
		cat += 4 * (h - 2)
		dog += 5 * (h - 2)
	return [h, cat, dog]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		cat_years = 15
		dog_years = 15
	elif human_years == 2:
		cat_years = 24
		dog_years = 24
	elif human_years == 3:
		cat_years = 28
		dog_years = 29
	else:
		cat_years = 28 + (human_years - 3) * 4
		dog_years = 29 + (human_years - 3) * 5
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	a = human_years
	if human_years == 1:
		d = 15
		c = 15
	elif human_years == 2:
		d = 24
		c = 24
	else:
		d = 24 + abs(human_years - 2) * 5
		c = 24 + abs(human_years - 2) * 4
	return [a, c, d]


def human_years_cat_years_dog_years(human_years):
	print(human_years)
	(cat_years, dog_years) = (0, 0)
	if human_years == 1:
		cat_years = 15
		dog_years = 15
	if human_years == 2:
		cat_years = 24
		dog_years = 24
	if human_years >= 3:
		cat_years += 4 * (human_years - 2) + 24
		dog_years += 5 * (human_years - 2) + 24
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		cat_years = 15
		dog_years = 15
	elif human_years == 2:
		cat_years = 15 + 9
		dog_years = 15 + 9
	elif human_years > 2:
		cat_years = 24 + (human_years - 2) * 4
		dog_years = 24 + (human_years - 2) * 5
	else:
		None
	return [human_years, cat_years, dog_years]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		(catYears, dogYears) = (15, 15)
	elif human_years == 2:
		(catYears, dogYears) = (24, 24)
	else:
		catYears = 24 + (human_years - 2) * 4
		dogYears = 24 + (human_years - 2) * 5
	return [human_years, catYears, dogYears]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		(cat_y, dog_y) = (15, 15)
	elif human_years == 2:
		(cat_y, dog_y) = (24, 24)
	else:
		cat_y = 24 + 4 * (human_years - 2)
		dog_y = 24 + 5 * (human_years - 2)
	return [human_years, cat_y, dog_y]


def human_years_cat_years_dog_years(human_years):
	if human_years == 1:
		(cat, dog) = (15, 15)
	if human_years == 2:
		(cat, dog) = (24, 24)
	if human_years >= 3:
		cat = 24 + (human_years - 2) * 4
		dog = 24 + (human_years - 2) * 5
	return [human_years, cat, dog]


def human_years_cat_years_dog_years(h):
	if h is 1:
		c = 15
		d = 15
	elif h is 2:
		c = 24
		d = 24
	else:
		c = 24 + (h - 2) * 4
		d = 24 + (h - 2) * 5
	return [h, c, d]


def human_years_cat_years_dog_years(human_years):
	years = [0, 0, 0]
	for i in range(0, human_years):
		if years[0] == 0:
			years[0] += 1
			years[1] += 15
			years[2] += 15
		elif years[0] == 1:
			years[0] += 1
			years[1] += 9
			years[2] += 9
		else:
			years[0] += 1
			years[1] += 4
			years[2] += 5
	return years


def human_years_cat_years_dog_years(human_years):
	caty = 0
	for i in range(0, human_years):
		if i == 0:
			caty += 15
		elif i == 1:
			caty += 9
		else:
			caty += 4
	dogy = 0
	for i in range(0, human_years):
		if i == 0:
			dogy += 15
		elif i == 1:
			dogy += 9
		else:
			dogy += 5
	return [human_years, caty, dogy]


def human_years_cat_years_dog_years(y):
	c = d = 15
	if y > 1:
		c = d = 24
	if y > 2:
		(c, d) = (c + 4 * (y - 2), d + 5 * (y - 2))
	return [y, c, d]


def human_years_cat_years_dog_years(human_years):
	return [human_years, 15 + (9 if human_years >= 2 else 0) + ((human_years - 2) * 4 if human_years >= 2 else 0), 15 + (9 if human_years >= 2 else 0) + ((human_years - 2) * 5 if human_years >= 2 else 0)]


def human_years_cat_years_dog_years(y):
	if y == 1:
		return [1, 15, 15]
	elif y == 2:
		return [2, 24, 24]
	else:
		return [y, 24 + (y - 2) * 4, 24 + (y - 2) * 5]


def human_years_cat_years_dog_years(human_years):
	f = 15
	s = 9
	if human_years == 1:
		return [human_years, f, f]
	elif human_years == 2:
		return [human_years, f + s, f + s]
	else:
		return [human_years, f + s + (human_years - 2) * 4, f + s + (human_years - 2) * 5]


def human_years_cat_years_dog_years(human):

	def animal(h, p):
		r = 0
		for i in range(1, h + 1):
			if i == 1:
				r += 15
			elif i == 2:
				r += 9
			else:
				r += p
		return r
	return [human, animal(human, 4), animal(human, 5)]


def human_years_cat_years_dog_years(h):
	return [h, 15 + 9 * int(h > 1) + 4 * (h - 2) * int(h > 2), 15 + 9 * int(h > 1) + 5 * (h - 2) * int(h > 2)]


def human_years_cat_years_dog_years(yr):
	return ['one-liner', [1, 15, 15], [2, 24, 24]][yr] if yr in range(1, 3) else [yr, (yr - 2) * 4 + 24, (yr - 2) * 5 + 24]


def human_years_cat_years_dog_years(human_years):
	cat_years = 15 * (human_years >= 1) + 9 * (human_years >= 2) + 4 * max(human_years - 2, 0)
	return [human_years, cat_years, cat_years + max(human_years - 2, 0)]


human_years_cat_years_dog_years = lambda h: [h, 15 + (h >= 2) * (9 + (h - 2) * 4), 15 + (h >= 2) * (9 + (h - 2) * 5)]


def human_years_cat_years_dog_years(human_years):
	cat_years = 0
	dog_years = 0
	human = human_years
	if human >= 1:
		cat_years = 15
		dog_years = 15
		human = human - 1
	if human >= 1:
		cat_years += 9
		dog_years += 9
		human = human - 1
	if human >= 1:
		cat_years += human * 4
		dog_years += human * 5
	return [human_years, cat_years, dog_years]