{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Cao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought the only way to beat Cao Cao is to have a spy in Cao Cao\u0027s army. But all generals and soldiers of Cao Cao were loyal, it\u0027s impossible to convince any of them to betray Cao Cao. \n \u003cbr\u003e \n \u003cbr\u003eSo there is only one way left for Yu Zhou, send someone to fake surrender Cao Cao. Gai Huang was selected for this important mission. However, Cao Cao was not easy to believe others, so Gai Huang must leak some important information to Cao Cao before surrendering. \n \u003cbr\u003e \n \u003cbr\u003eYu Zhou discussed with Gai Huang and worked out $N$ information to be leaked, in happening order. Each of the information was estimated to has $a_{i}$ value in Cao Cao\u0027s opinion. \n \u003cbr\u003e \n \u003cbr\u003eActually, if you leak information with strict increasing value could accelerate making Cao Cao believe you. So Gai Huang decided to leak exact $M$ information with strict increasing value in happening order. In other words, Gai Huang will not change the order of the $N$ information and just select $M$ of them. Find out how many ways Gai Huang could do this. \n\u003c/div\u003e\n给定一个长度为n的序列,从中选出一个长度为m的子序列。子序列满足严格递增。求方案数。"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input gives the number of test cases, $T(1≤100)$. $T$ test cases follow. \n\u003cbr\u003e \n\u003cbr\u003eEach test case begins with two numbers $N(1≤N≤10^3)$ 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 $i_{th}$ number $a_{i}(1≤a_{i}≤10^{9})$ indicates the value in Cao Cao\u0027s opinion of the $i_{th}$ information in happening order.\n第一行一个整数,表示测试数据的组数。\u003c/br\u003e\n接下来两个整数n和m,1\u003c\u003d M \u003c\u003d N \u003c\u003d 1000\u003c/br\u003e\n接下来一行n个数。1≤ai≤10^9\u003c/br\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line containing \n\u003cb\u003eCase #x: y\u003c/b\u003e, where $x$ is the test case number (starting from 1) and $y$ is the ways Gai Huang can select the information. \n\u003cbr\u003e \n\u003cbr\u003eThe result is too large, and you need to output the result mod by $1000000007(10^{9}+7)$.\n输出结果,对1000000007取余。"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n3 2\n1 2 3\n3 2\n3 2 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eCase #1: 3\nCase #2: 0\n\n \n \u003ci style\u003d\"font-size:1px\"\u003e \u003c/i\u003e\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003e\nIn the first cases, Gai Huang need to leak 2 information out of 3. He could leak any 2 information as all the information value are in increasing order. \nIn the second cases, Gai Huang has no choice as selecting any 2 information is not in increasing order.\n \u003c/pre\u003e\n样例1:(1,2),(2,3)(1,3)"}}]}