CF832A.Sasha and Sticks

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with friends.

Today he invented one simple game to play with Lena, with whom he shares a desk. The rules are simple. Sasha draws n sticks in a row. After that the players take turns crossing out exactly k sticks from left or right in each turn. Sasha moves first, because he is the inventor of the game. If there are less than k sticks on the paper before some turn, the game ends. Sasha wins if he makes strictly more moves than Lena. Sasha wants to know the result of the game before playing, you are to help him.

今天又是普通的一天。萨沙不喜欢上课,总是在课堂上感到无聊。因此,他每天都会发明一些游戏,独自或与朋友们一起玩。

今天,他发明了一个简单的游戏,准备和与他同桌的莉娜一起玩。游戏规则很简单:萨沙在纸上从左到右画出 nn 根竖线(即“棍子”)。之后,两名玩家轮流进行操作,每次操作必须从最左边或最右边恰好划掉 kk 根棍子。由于这个游戏是萨沙发明的,所以他先手。如果某一轮开始前,纸上剩余的棍子数量少于 kk 根,则游戏立即结束。若萨沙的操作次数严格多于莉娜的操作次数,则萨沙获胜。萨沙希望在实际开始游戏前就预知结果,而你的任务就是帮助他判断。

输入格式

The first line contains two integers n and k (1 ≤ n, k ≤ 1018, k ≤ n) — the number of sticks drawn by Sasha and the number k — the number of sticks to be crossed out on each turn.

第一行包含两个整数 nn 和 kk(1≤n, k≤10181 \leq n,\,k \leq 10^{18},且 k≤nk \leq n)—— 分别表示萨沙画出的木棍数量以及每轮需划掉的木棍数量。

输出格式

If Sasha wins, print "YES" (without quotes), otherwise print "NO" (without quotes).

You can print each letter in arbitrary case (upper of lower).

如果萨沙获胜,输出 “YES”(不带引号),否则输出 “NO”(不带引号)。

每个字母可以以任意大小写形式输出(大写或小写)。

输入输出样例

  • 输入#1

    1 1

    输出#1

    YES
  • 输入#2

    10 4

    输出#2

    NO

说明/提示

In the first example Sasha crosses out 1 stick, and then there are no sticks. So Lena can't make a move, and Sasha wins.

In the second example Sasha crosses out 4 sticks, then Lena crosses out 4 sticks, and after that there are only 2 sticks left. Sasha can't make a move. The players make equal number of moves, so Sasha doesn't win.

在第一个例子中,萨沙划掉了 1 根木棍,之后不再剩下任何木棍。因此莉娜无法进行操作,萨沙获胜。

在第二个例子中,萨沙划掉了 4 根木棍,接着莉娜也划掉了 4 根木棍,此后仅剩下 2 根木棍。萨沙无法进行操作。双方进行了相同次数的操作,因此萨沙未能获胜。

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

首页