Once Again...

题意翻译

## 题目描述 现有一个长度为 $n×T$ 的序列 $a_1, a_2, ..., a_{n×T}$ ,满足 $a_i=a_{i-n} (n<i<=n×T)$ 。请找出这个序列中的最长不降子序列的长度。 ## 输入输出格式 ### 输入格式 输入的第一行有两个空格隔开的整数 $n$ 和 $T$ $(1<=n<=100,1<=T<=10^7)$ 。第二行有$n$ 个空格隔开的正整数 $a_1,a_2,...,a_n (1<=a_i<=300)$ 描述了这个序列的前 $n$ 项。 ### 输出格式 输出一个整数——最长不降子序列的长度。 ## 输入输出样例 略 ## 说明 样例中给出的序列如下:3, **1**, 4, **2**, **3**, 1, **4**, 2, 3, 1, **4**, 2. 加粗的数字是一种最长不降子序列的方案。

题目描述

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&gt;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.

输入输出样例

输入样例 #1

4 3
3 1 4 2

输出样例 #1

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.