跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1494. Subsequences

    ID: 1500 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>数据结构动态规划提高难度共享题库Codeforces英文题面题目来源题面语言

Subsequences

题目描述

C. Subsequences
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

For the given sequence with n different elements find the number of increasing subsequences with k+1 elements. It is guaranteed that the answer is not greater than 8·1018.

Input

First line contain two integer values n and k (1≤n≤105,0≤k≤10) − the length of sequence and the number of elements in increasing subsequences.

Next n lines contains one integer ai (1≤ain) each − elements of sequence. All values ai are different.

Output

Print one integer − the answer to the problem.

Examples
Input
5 2
1
2
3
5
4
Output
7

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1003 题。保留原作者与原赛事署名。