Pagini recente » Cod sursa (job #1756851) | Cod sursa (job #2297443) | Cod sursa (job #1012178) | Cod sursa (job #2315820) | Cod sursa (job #2625002)
def corect (S):
n = 0
for i in range (1, 12):
temp = S//(5**i)
n += temp
if temp == 0:
break
return n
inpput = open("fact.in", "r")
ouut = open ("fact.out", "w")
P = int(inpput.readline())
if (P == 0):
ouut.write("1")
#inpput.close()
#ouut.close()
#exit(0)
else:
temp = 5*P
while corect(temp) > P:
temp -= 5
if corect(temp) == P:
temp = str(temp)
ouut.write(temp)
else:
ouut.write("-1")
inpput.close()
ouut.close()
exit(0)