编程介的小学生 2018-12-23 21:16 采纳率: 20.5%
浏览 483
已采纳

C语言解决一个关于最短路径的花费的问题,怎么利用C解决

Problem Description
There is an old country and the king fell in love with a devil. The devil always ask 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.

Something bad actually happen. The devil makes this kingdom's people infected by a disease called lolicon. Lolicon will take away people's life in silence.

Although z*p is died, his friend, y*wan is not a lolicon. Y*wan is the only one in the country who is immune of lolicon, because he like the adult one so much.

As this country is going to hell, y*wan want to save this country from lolicon, so he starts his journey.

You heard about it and want to help y*wan, but y*wan questioned your IQ, and give you a question, so you should solve it to prove your IQ is high enough.

The problem is about counting. How many undirected graphs satisfied the following constraints?

  1. This graph is a complete graph of size n.
  2. Every edge has integer cost from 1 to L.
  3. The cost of the shortest path from 1 to n is k.

Can you solve it?

output the answer 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<=5 n,k<=12,L<=10^9.

Output
For each test case, output the answer in one line.

Sample Input
2
3 3 3
4 4 4

Sample Output
8
668

  • 写回答

2条回答 默认 最新

  • threenewbee 2019-08-25 22:30
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

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