Antiprime Numbers
Time limit3sMemory limit512 MB
Given n up to 2e9, find the largest highly composite number (one with more divisors than every smaller positive integer) that does not exceed n.
- Level
Medium6 of 10
- Topics
- Number theory, Brute force, Combinatorics, Math
- Solved
- No attempts yet
Problem
A positive integer is called an antiprime (also known as a highly composite number) if it has strictly more divisors than every positive integer smaller than it. For example, are all antiprimes.
Given an integer , write a program that finds the largest antiprime that is not greater than .
Input
The first line contains a single integer ().
Output
Print, on a single line, the largest antiprime that is not greater than .