



'''simple docstring'''
def A__					(  UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_						,						):
						_UpperCamelCase      :	int				       =     list(snake_case_							)
						_UpperCamelCase      :	Dict				       =     list(snake_case_							)
						_UpperCamelCase      :	Tuple				       =     len(snake_case_							)
						_UpperCamelCase      :	Optional[int]				       =     len(snake_case_							)

						_UpperCamelCase      :	Optional[Any]				       =     [
						    [0 for _ in range(len_destination_seq + 1							)] for _ in range(len_source_seq + 1							)
						]
						_UpperCamelCase      :	List[str]				       =     [
						    ['''0''' for _ in range(len_destination_seq + 1							)] for _ in range(len_source_seq + 1							)
						]

						for i in range(1						,						len_source_seq + 1							):
												_UpperCamelCase      :	Any				       =     i * delete_cost
												_UpperCamelCase      :	str				       =     f'D{source_seq[i - 1]:c}'

						for i in range(1						,						len_destination_seq + 1							):
												_UpperCamelCase      :	Optional[int]				       =     i * insert_cost
												_UpperCamelCase      :	Union[str, Any]				       =     f'I{destination_seq[i - 1]:c}'

						for i in range(1						,						len_source_seq + 1							):
												for j in range(1						,						len_destination_seq + 1							):
																		if source_seq[i - 1] == destination_seq[j - 1]:
																								_UpperCamelCase      :	Union[str, Any]				       =     costs[i - 1][j - 1] + copy_cost
																								_UpperCamelCase      :	Optional[int]				       =     f'C{source_seq[i - 1]:c}'
																		else:
																								_UpperCamelCase      :	Dict				       =     costs[i - 1][j - 1] + replace_cost
																								_UpperCamelCase      :	Union[str, Any]				       =     f'R{source_seq[i - 1]:c}' + str(destination_seq[j - 1]							)

																		if costs[i - 1][j] + delete_cost < costs[i][j]:
																								_UpperCamelCase      :	Any				       =     costs[i - 1][j] + delete_cost
																								_UpperCamelCase      :	Optional[int]				       =     f'D{source_seq[i - 1]:c}'

																		if costs[i][j - 1] + insert_cost < costs[i][j]:
																								_UpperCamelCase      :	List[str]				       =     costs[i][j - 1] + insert_cost
																								_UpperCamelCase      :	Any				       =     f'I{destination_seq[j - 1]:c}'

						return costs, ops






def A__					(  UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_							):
						if i == 0 and j == 0:
												return []
						else:
												if ops[i][j][0] == "C" or ops[i][j][0] == "R":
																		_UpperCamelCase      :	int				       =     assemble_transformation(snake_case_						,						i - 1						,						j - 1							)
																		seq.append(ops[i][j]							)
																		return seq
												elif ops[i][j][0] == "D":
																		_UpperCamelCase      :	List[str]				       =     assemble_transformation(snake_case_						,						i - 1						,						snake_case_							)
																		seq.append(ops[i][j]							)
																		return seq
												else:
																		_UpperCamelCase      :	Any				       =     assemble_transformation(snake_case_						,						snake_case_						,						j - 1							)
																		seq.append(ops[i][j]							)
																		return seq


if __name__ == "__main__":
					snake_case_				:			Dict        =						compute_transform_tables('Python', 'Algorithms', -1, 1, 2, 2)

					snake_case_				:			int        =						len(operations)
					snake_case_				:			Optional[Any]        =						len(operations[0])
					snake_case_				:			Union[str, Any]        =						assemble_transformation(operations, m - 1, n - 1)

					snake_case_				:			int        =						list('Python')
					snake_case_				:			Any        =						0
					snake_case_				:			Tuple        =						0

					with open('min_cost.txt', 'w') as file:
										for op in sequence:
															print(''.join(string))

															if op[0] == "C":
																				file.write('%-16s' % 'Copy %c' % op[1])
																				file.write('\t\t\t' + ''.join(string))
																				file.write('\r\n')

																				cost -= 1
															elif op[0] == "R":
																				snake_case_				:			str        =						op[2]

																				file.write('%-16s' % ('Replace %c' % op[1] + ' with ' + str(op[2])))
																				file.write('\t\t' + ''.join(string))
																				file.write('\r\n')

																				cost += 1
															elif op[0] == "D":
																				string.pop(i)

																				file.write('%-16s' % 'Delete %c' % op[1])
																				file.write('\t\t\t' + ''.join(string))
																				file.write('\r\n')

																				cost += 2
															else:
																				string.insert(i, op[1])

																				file.write('%-16s' % 'Insert %c' % op[1])
																				file.write('\t\t\t' + ''.join(string))
																				file.write('\r\n')

																				cost += 2

															i += 1

										print(''.join(string))
										print('Cost: ', cost)

										file.write('\r\nMinimum cost: ' + str(cost))







'''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))


