


import os
import sys
import time

from . import transposition_cipher as trans_cipher






def        __lowerCAmelCase    ()->  None:




      """simple docstring"""

      snake_case_       =      '''Prehistoric Men.txt'''
      snake_case_       =      '''Output.txt'''
      snake_case_       =      int(input('''Enter key: '''					)					)
      snake_case_       =      input('''Encrypt/Decrypt [e/d]: '''					)

      if not os.path.exists(SCREAMING_SNAKE_CASE					):
            print(f'''File {input_file} does not exist. Quitting...'''					)
            sys.exit()
      if os.path.exists(SCREAMING_SNAKE_CASE					):
            print(f'''Overwrite {output_file}? [y/n]'''					)
            snake_case_       =      input('''> '''					)
            if not response.lower().startswith('''y'''					):
                  sys.exit()

      snake_case_       =      time.time()
      if mode.lower().startswith('''e'''					):
            with open(SCREAMING_SNAKE_CASE					) as f:
                  snake_case_       =      f.read()
            snake_case_       =      trans_cipher.encrypt_message(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)
      elif mode.lower().startswith('''d'''					):
            with open(SCREAMING_SNAKE_CASE					) as f:
                  snake_case_       =      f.read()
            snake_case_       =      trans_cipher.decrypt_message(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					)

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

      snake_case_       =      round(time.time() - start_time					,					2					)
      print(('''Done (''', total_time, '''seconds )''')					)


if __name__ == "__main__":
   main()



def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE = 1000					)->  int:




      """simple docstring"""

      snake_case_       =      0
      snake_case_       =      (n - 1) // 3
      total += ((terms) * (6 + (terms - 1) * 3)) // 2  # total of an A.P.
      snake_case_       =      (n - 1) // 5
      total += ((terms) * (10 + (terms - 1) * 5)) // 2
      snake_case_       =      (n - 1) // 15
      total -= ((terms) * (30 + (terms - 1) * 15)) // 2
      return total


if __name__ == "__main__":
   print(f'''{solution() = }''')