Cod sursa(job #2624990)

Utilizator tuddi69666Blidea Tudorel Alexandru tuddi69666 Data 5 iunie 2020 17:29:01
Problema Factorial Scor 0
Compilator py Status done
Runda Arhiva de probleme Marime 0.33 kb
def corect (S):
    n = 0
    for i in range (1, 12):
        temp = S//(5**i)
        n += temp
        if temp == 0:
            break
    return n


P = int(input())
if (P == 0):
	print (1):
	exit(0)
temp = 5*P
while corect(temp) > P:
    temp -= 5
if corect(temp) == P:
    print (temp)
else:
	print (-1)
exit(0)