QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 128 MB 總分: 100

#15265. Highly Composite Number

统计

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

If a positive integer $x$ satisfies $g(x) > g(i)$ for all $0 < i < x$, then $x$ is called a highly composite number. For example, the integers $1, 2, 4, 6$ are all highly composite numbers.

Given an integer $N$, can you find the largest highly composite number not exceeding $N$?

Input

The input consists of a single line containing an integer $N$ ($1 \le N \le 2,000,000,000$).

Output

Output a single line containing the largest highly composite number not exceeding $N$.

Examples

Input 1

1000

Output 1

840

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.