Antiprime Number


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
C++, Python

Anti-Prime Number Problem

For any positive integer x, let g(x) denote the number of its divisors. For example, g(1)=1, g(6)=4.

A positive integer x is called an anti-prime if for every positive integer i < x, we have g(x) > g(i).

For example, integers 1, 2, 4, 6 are anti-primes.

Given a number N, find the largest anti-prime not exceeding N.

Input Format
A single positive integer N.

Output Format
A single integer — the largest anti-prime ≤ N.

Data Range
1 ≤ N ≤ 2×109

Sample Input

1000

Sample Output

840

Comments

There are no comments at the moment.