#P6650. 「SWTR-5」Sequence
「SWTR-5」Sequence
Description
Xiao A has a sequence of length . He can choose an interval such that the difference between its maximum value and minimum value is at most .
He also needs to find pairwise distinct integers such that:
- is a positive integer.
- $\prod\limits_{i=l}^r a_i = \prod\limits_{i=1}^m p_i$. That is, the product of the chosen interval equals the product of these numbers.
- Each is a positive integer power of a prime.
The sum of the numbers of divisors of these numbers is Xiao A's score. Help him find the maximum possible score.
Input Format
The first line contains two integers .
The second line contains integers representing the sequence.
Output Format
Output one integer in a single line, the answer.
4 2
6 4 2 3
7
5 3
8 6 9 6 4
13
17 17
29 38 9 10 16 5 1 10 27 20 11 9 15 11 2 3 10
17
Hint
"Sample Explanation"
Sample : Choose the interval , then choose , , , and you can reach the maximum value . The solution is not unique.
Sample : Choose the interval , then choose , , , , and you can reach the maximum value .
"Constraints and Notes"
This problem uses bundled testdata.
- Subtask 1 (1 points): and is prime.
- Subtask 2 (9 points): .
- Subtask 3 (20 points): , .
- Subtask 4 (13 points): , .
- Subtask 5 (17 points): .
- Subtask 6 (15 points): is prime.
- Subtask 7 (25 points): no special restrictions.
For of the testdata: , , .
"Source"
Sweet Round 05 B.
idea & solution: ET2006.
Input Format
Output Format
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号