"""simple docstring"""




from math import pi, sqrt







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		if num <= 0:
				raise ValueError("""math domain error"""     )
		if num > 171.5:
				raise OverflowError("""math range error"""     )
		elif num - int(lowerCamelCase__     ) not in (0, 0.5):
				raise NotImplementedError("""num must be an integer or a half-integer"""     )
		elif num == 0.5:
				return sqrt(lowerCamelCase__     )
		else:
				return 1.0 if num == 1 else (num - 1) * gamma(num - 1     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		assert gamma(0.5     ) == sqrt(lowerCamelCase__     )
		assert gamma(1     ) == 1.0
		assert gamma(2     ) == 1.0


if __name__ == "__main__":
			from doctest import testmod

			testmod()
			__lowerCAmelCase    :							Dict													=						1.0
			while num:
						__lowerCAmelCase    :							Any													=						float(input("Gamma of: "))
						print(F"gamma({num}) = {gamma(num)}")
						print("\nEnter 0 to exit...")



"""simple docstring"""




def 							_UpperCAmelCase		(       lowerCamelCase__ = 50     ):





		"""simple docstring"""




		lowerCAmelCase__        =   [[0] * 3 for _ in range(length + 1     )]

		for row_length in range(length + 1     ):
				for tile_length in range(2			,  5     ):
						for tile_start in range(row_length - tile_length + 1     ):
								different_colour_ways_number[row_length][tile_length - 2] += (
								    different_colour_ways_number[row_length - tile_start - tile_length][
								        tile_length - 2
								    ]
								    + 1
								)

		return sum(different_colour_ways_number[length]     )


if __name__ == "__main__":
			print(F"{solution() = }")




