编程介的小学生 2017-09-29 11:39 采纳率: 20.5%
浏览 653
已采纳

Our happy ending

Problem Description
There is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy things. Although the king used to be wise and beloved by his people. Now he is just like a boy in love and can’t refuse any request from the devil. Also, this devil is looking like a very cute Loli.

Y*wan still remember the day he first meets the devil. Now everything is done and the devil is gone. Y*wan feel very sad and suicide.

You feel guilty after killing so many loli, so you suicide too.

Nobody survive in this silly story, but there is still some hope, because this is just a silly background story during one programming contest!

And the last problem is:

Given a sequence a_1,a_2,...,a_n, if we can take some of them(each a_i can only be used once), and they sum to k, then we say this sequence is a good sequence.

How many good sequence are there? Given that each a_i is an integer and 0<= a_i <= L.

You should output the result modulo 10^9+7.

Input
The first line contains an integer T, denoting the number of the test cases.
For each test case, the first line contains 3 integers n, k, L.

T<=20, n,k<=20 , 0<=L<=10^9.

Output
For each cases, output the answer in a single line.

Sample Input
1
2 2 2

Sample Output
6

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-10-17 00:41
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题