• [1594] Alex and Dice

  • 时间限制: 2000 ms 内存限制: 65535 K
  • 问题描述
  • One dayAlex is boring so he plays with diceshe has n dices and each of them has k faces numbered from 1 to k, You can rotate/flip any dice, Now he wants to know how many ways he can set the top faces such that the summation of all top faces equals S?

  • 输入
  • Input starts with an integer T(T <= 20) denoting the number of test cases;
    Each of the test case contains three integers n, k and S(1 <= n <= 1000, 1 <= k <= 1000, 0 <= S <= 15000)
  • 输出
  • For each test case print the case number and the result modulo 100000007.
  • 样例输入
  • 3
    1 6 3
    2 9 8
    500 6 1000
    
  • 样例输出
  • Case 1: 1
    Case 2: 7
    Case 3: 57286574
    
  • 提示
  • 来源
  • Alex@NBUT
  • 操作

显示春菜