题库练习 Once Again...
← 上一题 下一题 →

A9998 | Once Again...

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

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.

输入输出样例

输入 #1
4 3
3 1 4 2
输出 #1
5
C++ 编辑器
输入
输出