{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"You have **N** dices; each of them has **K** faces numbered from **1** to **K**. Now you have arranged the **N** dices in a line. You can rotate/flip any dice if you want. How many ways you can set the top faces such that the summation of all the top faces equals **S**?\n\nNow you are given **N, K, S**; you have to calculate the total number of ways."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 25)**, denoting the number of test cases.\n\nEach case contains three integers: **N (1 \u0026le; N \u0026le; 1000), K (1 \u0026le; K \u0026le; 1000)** and **S (0 \u0026le; S \u0026le; 15000)**."}},{"title":"Output","value":{"format":"MD","content":"For each case print the case number and the result modulo **100000007 (10\u003csup\u003e8\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\u003e5\n1 6 3\n2 9 8\n500 6 1000\n800 800 10000\n2 100 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 1\nCase 2: 7\nCase 3: 57286574\nCase 4: 72413502\nCase 5: 9\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}