




import os
import sys
import time

from . import transposition_cipher as trans_cipher
def 							__lowerCAmelCase			():
    a__  			=							"""Prehistoric Men.txt"""
    a__  			=							"""Output.txt"""
    a__  			=							int(input("""Enter key: """		)		)
    a__  			=							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]"""		)
        a__  			=							input("""> """		)
        if not response.lower().startswith("""y"""		):
            sys.exit()

    a__  			=							time.time()
    if mode.lower().startswith("""e"""		):
        with open(UpperCAmelCase_		) as f:
            a__  			=							f.read()
        a__  			=							trans_cipher.encrypt_message(UpperCAmelCase_ ,     UpperCAmelCase_		)
    elif mode.lower().startswith("""d"""		):
        with open(UpperCAmelCase_		) as f:
            a__  			=							f.read()
        a__  			=							trans_cipher.decrypt_message(UpperCAmelCase_ ,     UpperCAmelCase_		)

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

    a__  			=							round(time.time() - start_time ,     2		)
    print(("""Done (""", total_time, """seconds )""")		)


if __name__ == "__main__":
 main()












def 							__lowerCAmelCase			(UpperCAmelCase_		):
    return n * (2 * n - 1)
def 							__lowerCAmelCase			(UpperCAmelCase_		):
    a__  			=							(1 + 24 * n) ** 0.5
    return ((1 + root) / 6) % 1 == 0
def 							__lowerCAmelCase			(UpperCAmelCase_ = 144		):
    a__  			=							start
    a__  			=							hexagonal_num(UpperCAmelCase_		)
    while not is_pentagonal(UpperCAmelCase_		):
        n += 1
        a__  			=							hexagonal_num(UpperCAmelCase_		)
    return num


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






