






"""simple docstring"""



import math




def      _lowerCAmelCase		(							)		->None:
      A__						:  Any		  =  input("""Enter message: """      )
      A__						:  Optional[int]		  =  int(input(f'Enter key [2-{len(UpperCAmelCase__      ) - 1}]: '      )      )
      A__						:  Optional[int]		  =  input("""Encryption/Decryption [e/d]: """      )

      if mode.lower().startswith("""e"""      ):
            A__						:  int		  =  encrypt_message(UpperCAmelCase__,						UpperCAmelCase__      )
      elif mode.lower().startswith("""d"""      ):
            A__						:  List[Any]		  =  decrypt_message(UpperCAmelCase__,						UpperCAmelCase__      )

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




def      _lowerCAmelCase		(							UpperCAmelCase__       :					int,						UpperCAmelCase__       :					str      )		->str:
      A__						:  str		  =  [""""""] * key
      for col in range(UpperCAmelCase__      ):
            A__						:  str		  =  col
            while pointer < len(UpperCAmelCase__      ):
                  cipher_text[col] += message[pointer]
                  pointer += key
      return "".join(UpperCAmelCase__      )




def      _lowerCAmelCase		(							UpperCAmelCase__       :					int,						UpperCAmelCase__       :					str      )		->str:
      A__						:  Any		  =  math.ceil(len(UpperCAmelCase__      ) / key      )
      A__						:  Optional[int]		  =  key
      A__						:  Tuple		  =  (num_cols * num_rows) - len(UpperCAmelCase__      )
      A__						:  Optional[Any]		  =  [""""""] * num_cols
      A__						:  Optional[int]		  =  0
      A__						:  List[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)
            ):
                  A__						:  List[str]		  =  0
                  row += 1

      return "".join(UpperCAmelCase__      )


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()














"""simple docstring"""



from __future__ import annotations

A_    =							10




def      _lowerCAmelCase		(							UpperCAmelCase__       :					list[int]      )		->list[int]:
						A__						:  Any		  =  1
						A__						:  Optional[int]		  =  max(UpperCAmelCase__      )
						while placement <= max_digit:
												# declare and initialize empty buckets
												A__						:  list[list]		  =  [[] for _ in range(UpperCAmelCase__      )]
												# split list_of_ints between the buckets
												for i in list_of_ints:
																		A__						:  List[Any]		  =  int((i / placement) % RADIX      )
																		buckets[tmp].append(UpperCAmelCase__      )
												# put each buckets' contents into list_of_ints
												A__						:  Union[str, Any]		  =  0
												for b in range(UpperCAmelCase__      ):
																		for i in buckets[b]:
																								A__						:  str		  =  i
																								a += 1
        # move to next
												placement *= RADIX
						return list_of_ints


if __name__ == "__main__":
						import doctest

						doctest.testmod()






