Codeforces Round 323 (Div. 1)
B
Once Again...
Codeforces
1900
原题
← AC →
翻译中…

You are given an array of positive integers $*a*_{1}, *a*_{2}, ..., *a*_{*n* × *T*}$ of length $*n* × *T*$. We know that for any $*i* > *n*$ it is true that $*a*_{*i*} = *a*_{*i* - *n*}$. Find the length of the longest non-decreasing sequence of the given array.

翻译中…

Input

翻译中…

The first line contains two space-separated integers: $*n*$, $*T*$ ($1 ≤ *n* ≤ 100$, $1 ≤ *T* ≤ 10^{7}$). The second line contains $*n*$ space-separated integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ ($1 ≤ *a*_{*i*} ≤ 300$).

翻译中…

Output

翻译中…

Print a single number — the length of a sought sequence.

翻译中…

Note

翻译中…

The array given in the sample looks like that: 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2. The elements in bold form the largest non-decreasing subsequence.

翻译中…

样例

Input #1
4 3
3 1 4 2
Output #1
5
InputCopy OutputCopy
题目信息
题号
582B
时间限制
1 s
内存限制
256 MB
标签
构造
动态规划
矩阵

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。