





'''simple docstring'''




import colorsys

from PIL import Image  # type: ignore



def 		__A		(  lowerCamelCase_			,			lowerCamelCase_			,			lowerCamelCase_	):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE :				List[str]		=			x
		SCREAMING_SNAKE_CASE :				str		=			y
		for step in range(lowerCamelCase_	):  # noqa: B007
				SCREAMING_SNAKE_CASE :				List[str]		=			a * a - b * b + x
				SCREAMING_SNAKE_CASE :				Dict		=			2 * a * b + y
				SCREAMING_SNAKE_CASE :				List[str]		=			a_new

				# divergence happens for all complex number with an absolute value
				# greater than 4
				if a * a + b * b > 4:
						break
		return step / (max_step - 1)



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



		if distance == 1:
				return (0, 0, 0)
		else:
				return (2_55, 2_55, 2_55)



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



		if distance == 1:
				return (0, 0, 0)
		else:
				return tuple(round(i * 2_55	) for i in colorsys.hsv_to_rgb(lowerCamelCase_			,			1			,			1	)	)



def 		__A		(  lowerCamelCase_ = 8_00			,			lowerCamelCase_ = 6_00			,			lowerCamelCase_ = -0.6			,			lowerCamelCase_ = 0			,			lowerCamelCase_ = 3.2			,			lowerCamelCase_ = 50			,			lowerCamelCase_ = True			,			):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE :				Any		=			Image.new("""RGB"""			,			(image_width, image_height)	)
		SCREAMING_SNAKE_CASE :				Tuple		=			img.load()

		# loop through the image-coordinates
		for image_x in range(lowerCamelCase_	):
				for image_y in range(lowerCamelCase_	):
						# determine the figure-coordinates based on the image-coordinates
						SCREAMING_SNAKE_CASE :				Union[str, Any]		=			figure_width / image_width * image_height
						SCREAMING_SNAKE_CASE :				Dict		=			figure_center_x + (image_x / image_width - 0.5) * figure_width
						SCREAMING_SNAKE_CASE :				Union[str, Any]		=			figure_center_y + (image_y / image_height - 0.5) * figure_height

						SCREAMING_SNAKE_CASE :				str		=			get_distance(lowerCamelCase_			,			lowerCamelCase_			,			lowerCamelCase_	)

						# color the corresponding pixel based on the selected coloring-function
						if use_distance_color_coding:
								SCREAMING_SNAKE_CASE :				Union[str, Any]		=			get_color_coded_rgb(lowerCamelCase_	)
						else:
								SCREAMING_SNAKE_CASE :				Optional[Any]		=			get_black_and_white_rgb(lowerCamelCase_	)

		return img


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							# colored version, full figure
							__UpperCAmelCase            =       get_image()

							# uncomment for colored version, different section, zoomed in
							# img = get_image(figure_center_x = -0.6, figure_center_y = -0.4,
							# figure_width = 0.8)

							# uncomment for black and white version, full figure
							# img = get_image(use_distance_color_coding = False)

							# uncomment to save the image
							# img.save("mandelbrot.png")

							img.show()










'''simple docstring'''




from math import factorial



def 		__A		(  lowerCamelCase_			,			lowerCamelCase_	):


		"""simple docstring"""



		if n < k or k < 0:
				raise ValueError("""Please enter positive integers for n and k where n >= k"""	)
		return factorial(lowerCamelCase_	) // (factorial(lowerCamelCase_	) * factorial(n - k	))


if __name__ == "__main__":
							print(
							    """The number of five-card hands possible from a standard""",
							    f'''fifty-two card deck is: {combinations(52, 5)}\n''',
							)

							print(
							    """If a class of 40 students must be arranged into groups of""",
							    f'''4 for group projects, there are {combinations(40, 4)} ways''',
							    """to arrange them.\n""",
							)

							print(
							    """If 10 teams are competing in a Formula One race, there""",
							    f'''are {combinations(10, 3)} ways that first, second and''',
							    """third place can be awarded.""",
							)



