CF78C.Beaver Game

普及+/提高

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Two beavers, Timur and Marsel, play the following game.

There are n logs, each of exactly m meters in length. The beavers move in turns. For each move a beaver chooses a log and gnaws it into some number (more than one) of equal parts, the length of each one is expressed by an integer and is no less than k meters. Each resulting part is also a log which can be gnawed in future by any beaver. The beaver that can't make a move loses. Thus, the other beaver wins.

Timur makes the first move. The players play in the optimal way. Determine the winner.

两只河狸——蒂穆尔和马塞尔——玩如下游戏:

共有 nn 根原木,每根长度恰好为 mm 米。两只河狸轮流行动。每次行动中,一只河狸选择一根原木,并将其啃咬成若干(多于一个)等长的部分;每部分的长度必须为整数,且不小于 kk 米。每根生成的新原木今后均可被任意一只河狸继续啃咬。无法进行合法移动的河狸判负,另一只河狸获胜。

蒂穆尔先手。双方均以最优策略进行游戏。请判断获胜者。

输入格式

The first line contains three integers n, m, k (1 ≤ n, m, k ≤ 109).

第一行包含三个整数 nn、mm、kk(1 ≤ n, m, k ≤ 1091 ≤ n, m, k ≤ 10^9)。

输出格式

Print "Timur", if Timur wins, or "Marsel", if Marsel wins. You should print everything without the quotes.

如果提穆尔获胜,输出“Timur”;如果马塞尔获胜,输出“Marsel”。请不要输出引号。

输入输出样例

  • 输入#1

    1 15 4

    输出#1

    Timur
  • 输入#2

    4 9 5

    输出#2

    Marsel

说明/提示

In the first sample the beavers only have one log, of 15 meters in length. Timur moves first. The only move he can do is to split the log into 3 parts each 5 meters in length. Then Marsel moves but he can't split any of the resulting logs, as k = 4. Thus, the winner is Timur.

In the second example the beavers have 4 logs 9 meters in length. Timur can't split any of them, so that the resulting parts possessed the length of not less than 5 meters, that's why he loses instantly.

在第一个样例中,海狸只有一根长度为 15 米的原木。蒂穆尔先行动。他唯一能做的操作是将这根原木分成三段,每段长度均为 5 米。接着马塞尔行动,但他无法再分割任何一段得到的原木,因为 k=4k = 4。因此,获胜者是蒂穆尔。

在第二个样例中,海狸有 4 根长度均为 9 米的原木。蒂穆尔无法将其中任意一根原木分割成若干段,使得每段长度均不小于 5 米,因此他立即落败。

输入解题思路,AI测评打分。不知道怎么写?

首页