QOJ.ac

QOJ

Time Limit: 0.5 s Memory Limit: 64 MB Total points: 100

#23685. Factorial

Statistics

An integer $n$ ($2 \le n \le 100000000$) is given. Write a program to find the smallest positive integer $m$ such that the factorial of $m$ is divisible by $n$. Here, for a positive integer $m$, the factorial of $m$ is the product of all integers from $1$ to $m$.

Input

The input is given in the file factorial.in. This file consists of a single line containing the integer $n$.

Output

The program should output the result to the standard output. Output a single line containing only the integer $m$.

Sample

Input 1

10

Output 1

5

Input 2

12

Output 2

4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.