编程介的小学生 2019-09-16 09:43 采纳率: 20.5%
浏览 82

Funny Games 程序编写过程,谢谢

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 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发现数据能走到后端,但是放行之后就会提示错误
    • ¥30 3天&7天&&15天&销量如何统计同一行
    • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
    • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型