#include <bits/stdc++.h>
using namespace std;
int f[10000];
int a[100];
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < 100 * n; i++) {
    f[i] = 1;
    for (int j = i - 1; j >= max(0, i - n); j--) {
      if (a[i % n] >= a[j % n]) f[i] = max(f[i], f[j] + 1);
    }
  }
  if (t <= 100) {
    int ans = 0;
    for (int j = t * n - n; j < t * n; j++) ans = max(ans, f[j]);
    printf("%d\n", ans);
  } else {
    int ans = 0;
    for (int j = 99 * n; j < 100 * n; j++)
      ans = max(ans, f[j] + (f[j] - f[j - n]) * (t - 100));
    printf("%d\n", ans);
  }
  return 0;
}

### Prompt

Construct a CPP code solution to the problem outlined:

You are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i > n it is true that ai = ai - 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 ≤ 107). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 300).

Output

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

Examples

Input

4 3
3 1 4 2


Output

5

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. 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int f[10000];
int a[100];
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < 100 * n; i++) {
    f[i] = 1;
    for (int j = i - 1; j >= max(0, i - n); j--) {
      if (a[i % n] >= a[j % n]) f[i] = max(f[i], f[j] + 1);
    }
  }
  if (t <= 100) {
    int ans = 0;
    for (int j = t * n - n; j < t * n; j++) ans = max(ans, f[j]);
    printf("%d\n", ans);
  } else {
    int ans = 0;
    for (int j = 99 * n; j < 100 * n; j++)
      ans = max(ans, f[j] + (f[j] - f[j - n]) * (t - 100));
    printf("%d\n", ans);
  }
  return 0;
}

```