{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Consider this sequence **{1, 2, 3 ... N}**, as an initial sequence of first **N** natural numbers. You can rearrange this sequence in many ways. There will be a total of **N!** arrangements. You have to calculate the number of arrangements of first **N** natural numbers, where in first **M** positions; exactly **K** numbers are in their initial position.\n\nFor Example, **N \u003d 5, M \u003d 3, K \u003d 2**. You should count this arrangement **{1, 4, 3, 2, 5}**, here in first 3 positions 1 is in **1\u003csup\u003est\u003c/sup\u003e** position and 3 in **3\u003csup\u003erd\u003c/sup\u003e** position. So exactly 2 of its first 3 are in their initial position. But you should not count **{1, 2, 3, 4, 5}**."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026#8804; 1000)**, denoting the number of test cases.\n\nEach case contains three integers **N (1 \u0026#8804; N \u0026#8804; 1000), M (M \u0026#8804; N), K (0 \u0026lt; K \u0026#8804; M)**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the total number of possible arrangements modulo **1000000007 (10\u003csup\u003e9\u003c/sup\u003e + 7)**."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n5 3 2\n10 6 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 12\nCase 2: 64320\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}