编程介的小学生 2019-05-21 22:17 采纳率: 20.5%
浏览 462

数列分段判断的算法问题求解,怎么利用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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用三极管设计—个共射极放大电路
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示