【树状数组】Hdu5542 The Battle of Chibi

Description

给定一个长度为N的数列A,求A有多少个长度为M的严格递增子序列。1≤M≤N≤1000,序列A中的数的绝对值不超过
 〖10〗^9。因为答案可能很大,你只需要输出对 〖10〗^9+7 取模后的结果。

Input

The first line of the input gives the number of test cases, T(1≤100). T test cases follow.
Each test case begins with two numbers N(1≤N≤103) and M(1≤M≤N), 
indicating the number of information and number of information Gai Huang will select. 
Then N numbers in a line, the ith number ai(1≤ai≤10^9) 
indicates the value in Cao Cao's opinion of the ith information in happening order.

Output

For each test case, output one line containing Case #x: y, 
where x is the test case number (starting from 1) and y is the ways Gai Huang can select the information.
The result is too large, and you need to output the result mod by 1000000007(10^9+7).

Sample Input

2
3 2
1 2 3
3 2
3 2 1


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部