Codeforces Round #804 (Div. 2)
3 өдрийн дараа |
B. Once Again...
хугацааны хязгаарлалт 1 секунд
санах ойн хязгаарлалт 256 мегабайт
оролт стандарт оролт
гаралт стандарт гаралт
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.
Оролт
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$).
Гаралт
Print a single number -- the length of a sought sequence.
Орчуулсан: [орчуулагдаж байгаа]
Жишээ тэстүүд
Оролт
4 3 3 1 4 2
Гаралт
5
Тэмдэглэл
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.