# 请问这个算法是不是用动态DP还是深搜？用C语言

Problem Description
Zty has met a big problem.His X Gu Niang was kidnaped by a secret organization.The organization only left Zty a letter:
"If you can beat our boss ,we will give her the freedom,or..."
The boss of the organization was so secret that no one knows his name.We only know that he was so powerful,and Zty is not powerful enough now,what he need to do is to train and to get more experience(Exp).Then he found a place wonderful for traning,There are N enemies there with different Exp,and Zty has M power ball,the number of power ball he used will effect the probability he beat the enemy.These probabilities are given as percentages pij, where i (with 1 ≤ i ≤ N) is the number of the enemy and j is the quantity of power balls used on it.One power ball can be used only once.
Zty has to level up to 99,then he will be able to beat the boss.Of cause he is level 1 at the begining.He want to know weather the maximal expected Exp he can get is enough.The expected Exp is calculated as Sum(P(i)*Exp) where P is the probability.
The Exp Zty need to level up one level is K/100 , and K will be given.

Notice that: If Zty doesn't used a power ball,the probability he beat the enemy is 0. ^_^

Input
The first line contain a T ,then T cases followed.Each test case has the following format:
One line with one integer K <= 100000: as the description means.
One line with one integer N with 1 ≤ N ≤ 100: the number of enemies.
One line with one integer M with 0 ≤ M ≤ 100: the maximal number of available power ball.
One line with N integers indicating the Exp of the N enemies.
N lines, each line corresponding to a enemy i, containing n integers pi1, pi2, …, pim (the percentages, with 0 ≤ pi1, pi2, …, pim ≤ 100).

Output
If the maximal expected Exp Zty can get is enough for him to level up tp 99,then ouput "Love you Ten thousand years.",else ouput"Cry,men,not crime."

Sample Input
2
1000
2
4
8 975
85 94 93 100
0 0 100 100
1000
1
4
979
0 0 0 100

Sample Output
Love you Ten thousand years.
Cry,men,not crime.

• 写回答

#### 1条回答默认 最新

• threenewbee 2019-01-24 23:47
关注
本回答被题主选为最佳回答 , 对您是否有帮助呢?
评论

#### 悬赏问题

• ¥15 IDEA构建失败？怎么搞
• ¥15 求该题的simpson，牛顿科特斯matlab代码，越快越好
• ¥30 求解，有偿，可商量价格
• ¥15 编译arm板子的gcc
• ¥15 C++代码报错问题，c++20协程
• ¥15 c++图Djikstra算法求最短路径
• ¥15 Linux操作系统中的，管道通信问题
• ¥15 ansible tower 卡住
• ¥15 等间距平面螺旋天线方程式
• ¥15 通过链接访问，显示514或不是私密连接