fork download
  1. M=1234567891
  2. def Dem(n,k):
  3. p=k;res=0
  4. while p<=n:
  5. res+=n//p
  6. p=p*k
  7. return res
  8. def LT(x, y):
  9. if y==0: return 1
  10. res=LT(x,y//2)
  11. res=(res*res)%M
  12. if y%2==1: res=(res*x%M)%M
  13. return res
  14. n=int(input())
  15. d=[0]*(n+1)
  16. ans=1
  17. i=2
  18. while i*i*2<=n:
  19. if d[i]==0:
  20. j=i*i
  21. while j*2<=n:
  22. d[j]=1
  23. j+=i
  24. i+=1
  25. i=2
  26. while i*2<=n:
  27. if d[i]==0:
  28. ans=(ans*LT(i,Dem(n,i)//2*2)%M)%M
  29. i+=1
  30. print(ans)
  31.  
Runtime error #stdin #stdout #stderr 0.16s 25660KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
EOFError: EOF when reading a line