Mistři v programování na #hovnokod

Python #428

fout = open("number23.out", "w")
fin = open("number23.in", "r")
N = int(fin.read())
secret = 6
key = 9
system = 10
Magic23 = 23
magic1 = magic2 = 0
if(N < Magic23//2):
    N = Magic23//2
for j in range(0, Magic23//2 + (Magic23 - 1)*((N - Magic23//2)//(Magic23-1)) - 1, 2):
    magic1 *= system
    magic1 += key - secret
    magic1 *= system
    magic1 += secret
    magic2 *= system
    magic2 += key - (system - secret)
    magic2 *= system
    magic2 += system - secret
magic1 *= system
magic1 += system - secret
magic2 *= system
magic2 += secret
if(N % 2):
    power = str(magic1 ** 2)
    fout.write(power[len(power)//2:])
else:
    power = str(magic2 ** 2)
    fout.write(power[len(power)//2:])
fout.close()
fin.close()

HovnoKod,