#P11026. [2016杭电多校]Palindrome Bo
[2016杭电多校]Palindrome Bo
Palindrome Bo
Problem Description
There is an array with elements named .If is a palindrome subsequence of ,whose elements are increasing from the middle to both ends,then we call it a BoBo sequence. Two BoBo sequence are considered different if and only if they have different length or there is at least one position has a different number. Your task is to calculate how many different longest BoBo sequence are there in .
Input
There are several test cases. The first line contains an integer . The second contains numbers indicating .
Output
One line two number indicating the length of the longest BoBo sequence and the quantity of them. answer mod 10^9+7
Sample Input
5
1 1 1 1 1
5
2 2 3 2 2
Sample Output
5 1
4 1
Author
绍兴一中
Source
2016 Multi-University Training Contest 3