




"""simple docstring"""







import unittest
from timeit import timeit





def 							lowercase   (snake_case__				:	int ,    snake_case__				:	int	)       ->					int:


				'''simple docstring'''






				lowerCAmelCase		=			first_num if first_num >= second_num else second_num
				lowerCAmelCase		=			max_num
				while (common_mult % first_num > 0) or (common_mult % second_num > 0):
								common_mult += max_num
				return common_mult





def 							lowercase   (snake_case__				:	int ,    snake_case__				:	int	)       ->					int:


				'''simple docstring'''






				return b if a == 0 else greatest_common_divisor(b % a ,    snake_case__	)





def 							lowercase   (snake_case__				:	int ,    snake_case__				:	int	)       ->					int:


				'''simple docstring'''






				return first_num // greatest_common_divisor(snake_case__ ,    snake_case__	) * second_num





def 							lowercase   ()       ->					str:


				'''simple docstring'''






				lowerCAmelCase		=			(
				    """from __main__ import least_common_multiple_slow, least_common_multiple_fast"""
				)
				print(
				    """least_common_multiple_slow():""" ,    timeit("""least_common_multiple_slow(1000, 999)""" ,    setup=snake_case__	) ,    )
				print(
				    """least_common_multiple_fast():""" ,    timeit("""least_common_multiple_fast(1000, 999)""" ,    setup=snake_case__	) ,    )






class  SCREAMING_SNAKE_CASE__   (   unittest.TestCase   ):
						_a        =  (
						    (10, 20),
						    (13, 15),
						    (4, 31),
						    (10, 42),
						    (43, 34),
						    (5, 12),
						    (12, 25),
						    (10, 25),
						    (6, 9),
						)
						_a        =  (20, 1_95, 1_24, 2_10, 14_62, 60, 3_00, 50, 18)


						def 					__lowercase	(							self			:     Optional[int]   ):
										for i, (first_num, second_num) in enumerate(self.test_inputs   ):
														lowerCAmelCase		=			least_common_multiple_slow(lowercase_  ,  lowercase_   )
														lowerCAmelCase		=			least_common_multiple_fast(lowercase_  ,  lowercase_   )
														with self.subTest(i=lowercase_   ):
																		self.assertEqual(lowercase_  ,  self.expected_results[i]   )
																		self.assertEqual(lowercase_  ,  self.expected_results[i]   )


if __name__ == "__main__":
		benchmark()
		unittest.main()








"""simple docstring"""







def 							lowercase   (snake_case__				:	int	)       ->					int:


				'''simple docstring'''






				barcode //= 10  # exclude the last digit
				lowerCAmelCase		=			False
				lowerCAmelCase		=			0

				# extract and check each digit
				while barcode != 0:
								lowerCAmelCase		=			1 if checker else 3
								s += mult * (barcode % 10)
								barcode //= 10
								lowerCAmelCase		=			not checker

				return (10 - (s % 10)) % 10





def 							lowercase   (snake_case__				:	int	)       ->					bool:


				'''simple docstring'''






				return len(str(snake_case__	)	) == 13 and get_check_digit(snake_case__	) == barcode % 10





def 							lowercase   (snake_case__				:	str	)       ->					int:


				'''simple docstring'''






				if str(snake_case__	).isalpha():
								lowerCAmelCase		=			f'''Barcode \'{barcode}\' has alphabetic characters.'''
								raise ValueError(snake_case__	)
				elif int(snake_case__	) < 0:
								raise ValueError("""The entered barcode has a negative value. Try again."""	)
				else:
								return int(snake_case__	)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		a								=							get_barcode(input('Barcode: ').strip())

		if is_valid(barcode):
				print(f"""'{barcode}' is a valid barcode.""")
		else:
				print(f"""'{barcode}' is NOT a valid barcode.""")





