编程介的小学生 2019-05-30 16:16 采纳率: 20.5%
浏览 196

关于比赛胜负的预测问题,怎么使用C语言的程序的编写的代码技术实现的呢?

Problem Description
Nils and Mikael are intergalaxial fighters. Now they are competing for the planet Tellus. The size of this small and unimportant planet is 1 < X < 10000 gobs. The problem is that their pockets only have room for one gob, so they have to reduce the size of the planet. They have available 1 <= K <= 6 FACTOR-weapons characterized by numbers F1, F2, . . . , Fk, all less than 0.9. As is commonly known, a FACTOR-weapon will blow off part of the planet, thus reducing the planet to a fraction of its size, given by the characteristic. Thus, with e.g. F1 = 0.5 an application of the first weapon will half the size of the planet. The fighter who reduces the size to less than, or equal to, 1 gob can take the planet home with him. They take turns attacking the planet with any weapon. If Nils starts, who will win the planet? Assume that both Nils and Mikael are omniscient and always make a winning move if there is one.
Technical note: To ease the problem of rounding errors, there will be no edge cases where an infinitesimal perturbation of the input values would cause a different answer.

Input
The first line of input is N <= 100, the number of test cases. Each of the next N lines consists of X, K and then the K numbers F1, F2, . . . , Fk, having no more than 6 decimals

Output
For each test case, produce one line of output with the name of the winner (either Nils or Mikael).

Sample Input
4
6 2 0.25 0.5
10 2 0.25 0.5
29.29 4 0.3 0.7 0.43 0.54
29.30 4 0.3 0.7 0.43 0.54

Sample Output
Mikael
Nils
Nils
Mikael

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

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