Maximize the Ratio
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Consider the function R(x) of positive integer x as R(x) = x / S(x), where S(x) is the sum of all divisors of x. For example, R(6) = 6 / (1 + 2 + 3 + 6) = 0.5, R(7) = 7 / (1 + 7) = 0.875 . Given n, find an integer x ≤ n such that R(X) is maximal. If there is more than one such integer, choose the maximal one.
Input
One integer n (1 ≤ n ≤ 10^5
).
Output
Print one integer x: the answer to the problem.
Examples
Input #1
Answer #1
Submissions 42
Acceptance rate 88%