#C700. Find the N-th Prime Number

    ID: 50823 Type: Default 1000ms 256MiB

Find the N-th Prime Number

Find the N-th Prime Number

You are given a positive integer n and your task is to find the n-th prime number. In mathematical terms, if we let \(p_i\) denote the \(i\)-th prime number, you need to output \(p_n\) where \(1 \le n \le 10000\). For any input where n is less than 1, output None.

Note: A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For example, the first few prime numbers are 2, 3, 5, 7, 11, ...

Examples:

  • Input: 1, Output: 2
  • Input: 5, Output: 11
  • Input: 10, Output: 29
  • Input: 20, Output: 71
  • Input: 100, Output: 541
  • Input: 10000, Output: 104729
  • Input: 0 or any negative number, Output: None

inputFormat

The input consists of a single integer (n) provided via standard input (stdin). The integer satisfies (1 \le n \le 10000). For any value of (n < 1), output should be None.

outputFormat

Print the (n)-th prime number to standard output (stdout). If (n < 1), print None.## sample

1
2

</p>