

'''simple docstring'''

import os
import sys
import time

from . import transposition_cipher as trans_cipher




def  UpperCamelCase(	):
 UpperCAmelCase			:      List[str]		   =					'Prehistoric Men.txt'
 UpperCAmelCase			:      Tuple		   =					'Output.txt'
 UpperCAmelCase			:      Optional[Any]		   =					int(input('Enter key: '      )      )
 UpperCAmelCase			:      List[Any]		   =					input('Encrypt/Decrypt [e/d]: '      )

 if not os.path.exists(UpperCAmelCase_      ):
  print(F"""File {input_file} does not exist. Quitting..."""      )
  sys.exit()
 if os.path.exists(UpperCAmelCase_      ):
  print(F"""Overwrite {output_file}? [y/n]"""      )
  UpperCAmelCase			:      List[Any]		   =					input('> '      )
  if not response.lower().startswith('y'      ):
   sys.exit()

 UpperCAmelCase			:      int		   =					time.time()
 if mode.lower().startswith('e'      ):
  with open(UpperCAmelCase_      ) as f:
   UpperCAmelCase			:      List[Any]		   =					f.read()
  UpperCAmelCase			:      Optional[int]		   =					trans_cipher.encrypt_message(UpperCAmelCase_    ,			UpperCAmelCase_      )
 elif mode.lower().startswith('d'      ):
  with open(UpperCAmelCase_      ) as f:
   UpperCAmelCase			:      Optional[Any]		   =					f.read()
  UpperCAmelCase			:      Tuple		   =					trans_cipher.decrypt_message(UpperCAmelCase_    ,			UpperCAmelCase_      )

 with open(UpperCAmelCase_    ,			'w'      ) as output_obj:
  output_obj.write(UpperCAmelCase_      )

 UpperCAmelCase			:      Dict		   =					round(time.time() - start_time    ,			2      )
 print(('Done (', total_time, 'seconds )')      )


if __name__ == "__main__":
 main()







'''simple docstring'''

def  UpperCamelCase(	UpperCAmelCase_ = 1_00      ):
 UpperCAmelCase			:      Optional[Any]		   =					[[0 for _ in range(UpperCAmelCase_      )] for _ in range(m + 1      )]
 for i in range(m + 1      ):
  UpperCAmelCase			:      Optional[int]		   =					1

 for n in range(m + 1      ):
  for k in range(1    ,			UpperCAmelCase_      ):
   memo[n][k] += memo[n][k - 1]
   if n > k:
    memo[n][k] += memo[n - k - 1][k]

 return memo[m][m - 1] - 1


if __name__ == "__main__":
 print(solution(int(input("Enter a number: ").strip())))




