



'''simple docstring'''
from cva import destroyAllWindows, imread, imshow, waitKey






def A__					(  UpperCAmelCase_						,						UpperCAmelCase_							):
						_UpperCamelCase       ,    _UpperCamelCase      :	Dict				       =     img.shape[0], img.shape[1]

						def to_grayscale(UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_							):
												return 0.2_126 * red + 0.587 * green + 0.114 * blue

						def normalize(UpperCAmelCase_							):
												return min(UpperCAmelCase_						,						2_5_5							)

						for i in range(UpperCAmelCase_							):
												for j in range(UpperCAmelCase_							):
																		_UpperCamelCase      :	Union[str, Any]				       =     int(to_grayscale(*img[i][j]							)							)
																		_UpperCamelCase      :	List[str]				       =     [
																		    normalize(UpperCAmelCase_							),
																		    normalize(greyscale + factor							),
																		    normalize(greyscale + 2 * factor							),
																		]

						return img


if __name__ == "__main__":
					# read original image
					snake_case_				:			Tuple						 =						{
					    percentage: imread('image_data/lena.jpg', 1) for percentage in (10, 20, 30, 40)
					}

					for percentage, img in images.items():
										make_sepia(img, percentage)

					for percentage, img in images.items():
										imshow(F"""Original image with sepia (factor: {percentage})""", img)

					waitKey(0)
					destroyAllWindows()







'''simple docstring'''
import math






def A__					(  UpperCAmelCase_							):

						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or number % 2 == 0 or number % 3 == 0:
												# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
												return False

						# All primes number are in format of 6k +/- 1
						for i in range(5						,						int(math.sqrt(UpperCAmelCase_							) + 1							)						,						6							):
												if number % i == 0 or number % (i + 2) == 0:
																		return False
						return True






def A__					(  UpperCAmelCase_ = 1_0_0_0						,						UpperCAmelCase_ = 1_0_0_0							):
						_UpperCamelCase      :	str				       =     [0, 0, 0]  # length, a, b
						for a in range((a_limit * -1) + 1						,						UpperCAmelCase_							):
												for b in range(2						,						UpperCAmelCase_							):
																		if is_prime(UpperCAmelCase_							):
																								_UpperCamelCase      :	List[str]				       =     0
																								_UpperCamelCase      :	Union[str, Any]				       =     0
																								while is_prime((n**2) + (a * n) + b							):
																														count += 1
																														n += 1
																								if count > longest[0]:
																														_UpperCamelCase      :	Any				       =     [count, a, b]
						_UpperCamelCase      :	Dict				       =     longest[1] * longest[2]
						return ans


if __name__ == "__main__":
					print(solution(1000, 1000))


