Divisibility test

Time: 1.0 s     Memory: 1024 MB
  • Do you know your divisibility rules?

    Input

    The only line of input contains an integer $2 \leq N \leq 10^{10^5}$.

    Output

    Output the smallest prime $p$ that is a divisor to $N$. $p \leq 20$ is guaranteed.

    Scoring

    Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group you need to solve all test cases in the test group.

    Group

    Point value

    Constraints

    $1$

    $1$

    $N \leq 10^5$

    $2$

    $10$

    $p = 2$

    $3$

    $10$

    $p = 3$

    $4$

    $10$

    $p = 5$

    $5$

    $10$

    $p = 7$

    $6$

    $10$

    $p = 11$

    $7$

    $49$

    No additional constraints.

    Extra samples

    Sample 4 can be downloaded here (too large to be uploaded to the website). The answer is 7.

    Sample Input 1 Sample Output 1
    9
    
    3
    
    Sample Input 2 Sample Output 2
    30
    
    2
    
    Sample Input 3 Sample Output 3
    5
    
    5
    
April fools 2024
You must log in to submit solutions to the problem.
{"contest_start_timestamp": 1711962000, "contest_duration": 7200, "contest_started": true, "contest_ended": true, "flexible_start_window_end_time": null, "only_virtual": false}