



'''simple docstring'''




import math

def 	__UpperCAmelCase       ( )->    None:



			"""simple docstring"""



			snake_case_				:					Optional[Any]   =       input("Enter message: "						)
			snake_case_				:					Dict   =       int(input(F'''Enter key [2-{len(_A						) - 1}]: '''						)						)
			snake_case_				:					Any   =       input("Encryption/Decryption [e/d]: "						)

			if mode.lower().startswith("e"						):
						snake_case_				:					Union[str, Any]   =       encrypt_message(_A     ,_A						)
			elif mode.lower().startswith("d"						):
						snake_case_				:					int   =       decrypt_message(_A     ,_A						)

			# Append pipe symbol (vertical bar) to identify spaces at the end.
			print(F'''Output:\n{text + '|'}'''						)

def 	__UpperCAmelCase       ( __magic_name__     ,__magic_name__						)->    str:



			"""simple docstring"""



			snake_case_				:					str   =       [""] * key
			for col in range(_A						):
						snake_case_				:					str   =       col
						while pointer < len(_A						):
									cipher_text[col] += message[pointer]
									pointer += key
			return "".join(_A						)

def 	__UpperCAmelCase       ( __magic_name__     ,__magic_name__						)->    str:



			"""simple docstring"""



			snake_case_				:					str   =       math.ceil(len(_A						) / key						)
			snake_case_				:					List[str]   =       key
			snake_case_				:					Union[str, Any]   =       (num_cols * num_rows) - len(_A						)
			snake_case_				:					Tuple   =       [""] * num_cols
			snake_case_				:					Any   =       0
			snake_case_				:					str   =       0

			for symbol in message:
						plain_text[col] += symbol
						col += 1

						if (
						    (col == num_cols)
						    or (col == num_cols - 1)
						    and (row >= num_rows - num_shaded_boxes)
						):
									snake_case_				:					List[str]   =       0
									row += 1

			return "".join(_A						)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		main()












'''simple docstring'''




def 	__UpperCAmelCase       ( __magic_name__						)->    list[int]:



			"""simple docstring"""



			if length <= 0 or not isinstance(__magic_name__     ,__magic_name__						):
						raise ValueError("Length must be a positive integer."						)
			return [n * (2 * n - 1) for n in range(__magic_name__						)]


if __name__ == "__main__":
		print(hexagonal_numbers(length=5))
		print(hexagonal_numbers(length=10))




