#P1082E. Increasing Frequency
Increasing Frequency
No submission language available for this problem.
Description
You are given array of length . You can choose one segment () and integer value (positive, negative or even zero) and change by each (i.e. for each ).
What is the maximum possible number of elements with value that can be obtained after one such operation?
The first line contains two integers and (, ) — the length of array and the value to obtain.
The second line contains integers () — array .
Print one integer — the maximum possible number of elements with value which can be obtained after performing operation described above.
Input
The first line contains two integers and (, ) — the length of array and the value to obtain.
The second line contains integers () — array .
Output
Print one integer — the maximum possible number of elements with value which can be obtained after performing operation described above.
Samples
Note
In the first example we can choose any segment and . The array will stay same.
In the second example we can choose segment and . The array will become .