#SP0000036. Số lượng ước tối đa (Maximum Factors)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Số lượng ước tối đa (Maximum Factors)
Maximum Factors
Source: CodeChef
Version: Phuoc Hung OJ Extended
Problem Statement
You are given a positive integer . Choose a positive divisor of such that , and define
A positive divisor of is a positive integer for which is divisible by .
Among all valid choices of , maximize the number of positive divisors of . If several values of attain the same maximum, choose the smallest one.
For the special case , this version defines the answer as , following the behavior of the source's reference implementation.
Input
One line containing a positive integer .
Output
Print one integer: the smallest optimal , or if .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
18
Output
3
Explanation
The divisors of are .
- For , has positive divisors: .
- For , has positive divisors: .
- For , has positive divisors.
- For , has positive divisors.
- For , has positive divisor.
The maximum divisor count is , attained for , so the output is 3.
Input
72
Output
2
Explanation
We have . Choosing gives , whose nine positive divisors are . Choosing gives , which has only eight positive divisors. No other yields more than nine, hence the answer is 2.
Input
1
Output
1
Explanation
There is no divisor when . By the explicitly stated special convention, print 1.