Жишээ тэстүүд

Оролт
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.