编程介的小学生 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 matlab数字图像处理频率域滤波
    • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
    • ¥15 ELGamal和paillier计算效率谁快?
    • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
    • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
    • ¥15 Arcgis相交分析无法绘制一个或多个图形
    • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
    • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
    • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
    • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误