[BOJ 8027] Antiprime Numbers

View as PDF

Submit solution

Points: 3
Time limit: 3.0s
Memory limit: 512M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

We call a positive integer an antiprime if it has more divisors than any positive integer less than that number. Example antiprime numbers are: 1, 2, 4, 6, 12, 24.</p>

Write a program which:

  • reads from the standard input a positive integer n,
  • computes the largest antiprime number not greater than n,
  • writes the result to the standard output.
## 입력 형식

The first and only line of standard input contains a single integer n, 1 ≤ n ≤ 2,000,000,000.

출력 형식

In the only line of standard output your program should write one integer - the largest antiprime number not greater than n.

예제 입력

1000

예제 출력

840

Comments

There are no comments at the moment.