A. Sasha and Sticks

time limit per test2 seconds

memory limit per test256 megabytes

inputstandard input

outputstandard output

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.

Input

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.

Output

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

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

Examples

input

1 1

output

YES

input

10 4

output

NO

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <map>
#include <stack>
#include <queue> using namespace std;
typedef long long int LL;
LL k,n;
int main()
{
scanf("%lld%lld",&k,&n);
LL ans=k/n;
if(ans&1)
printf("YES\n");
else
printf("NO\n");
return 0;
}

CodeForce 832A Sasha and Sticks的更多相关文章

  1. Codeforces 832A. Sasha and Sticks

    It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day h ...

  2. Codeforces Round #425 (Div. 2) Problem A Sasha and Sticks (Codeforces 832A)

    It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day h ...

  3. 【Codeforces Round #425 (Div. 2) A】Sasha and Sticks

    [Link]: [Description] [Solution] 傻逼题; 获取n/k; 对n/k的奇偶性讨论一下就好 [NumberOf WA] 0 [Reviw] [Code] #include ...

  4. codeforces round 425 div2

    A. Sasha and Sticks 水题,判断一下次数的奇和偶就可以的. B. Petya and Exam 赛上的时候没有写出来,orz,记录一下吧. 题意:给出一个模式串,可能会有?和*两种符 ...

  5. Codeforces Round #425 (Div. 2))——A题&&B题&&D题

    A. Sasha and Sticks 题目链接:http://codeforces.com/contest/832/problem/A 题目意思:n个棍,双方每次取k个,取得多次数的人获胜,Sash ...

  6. 【找规律】CodeForce #258 Problem A——Game With Sticks

    来源:点击打开链接 非常easy.找规律. 每去掉一个点,点的总数量就减去n+m-1,然后看谁最先减到没有点可减.就能够了. #include <iostream> #include &l ...

  7. HDOJ 1051. Wooden Sticks 贪心 结构体排序

    Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) To ...

  8. POJ 2653 Pick-up sticks (线段相交)

    题意:给你n条线段依次放到二维平面上,问最后有哪些没与前面的线段相交,即它是顶上的线段 题解:数据弱,正向纯模拟可过 但是有一个陷阱:如果我们从后面向前枚举,找与前面哪些相交,再删除前面那些相交的线段 ...

  9. 【Codeforces718C】Sasha and Array 线段树 + 矩阵乘法

    C. Sasha and Array time limit per test:5 seconds memory limit per test:256 megabytes input:standard ...

随机推荐

  1. Java 流(Stream)、文件(File)和IO -- Java ByteArrayOutputStream类

    Java ByteArrayOutputStream类 字节数组输出流在内存中创建一个字节数组缓冲区,所有发送到输出流的数据保存在该字节数组缓冲区中.创建字节数组输出流对象有以下几种方式. 下面的构造 ...

  2. 九度 1464:Hello World for U

    题目描述: Given any string of N (>=5) characters, you are asked to form the characters into the shape ...

  3. WAMP运行分析

  4. express安装及使用(windows系统)

    npm install express //安装express命令 npm install express-generator -g //Express 应用生成器,通过应用生成器工具 express ...

  5. [Linux] 如何修改 Linux 主机名

    该方法适用于安装了 Linux 系统的Raspberry Pi & Cubieboard. 在终端执行: sudo vi /etc/hosts 你看到的 hosts 文件应该是这样的: 127 ...

  6. 给TextView加上多彩效果:改变部分字体的大小和颜色

    转载请注明出处:http://blog.csdn.net/singwhatiwanna/article/details/18363899 前言 在实际使用中,有时候会遇到特殊需求,比如pm突发奇想,想 ...

  7. C语言中打印返回值

    demo: ----return :返回值------------------ int mosquitto_username_pw_set(struct mosquitto *mosq, const ...

  8. 使用es6的蹦床函数解决递归造成的堆栈溢出

      首先,我们先定义一个函数,使用递归的思想写求和的方法: function sum(x, y) { if (y > 0) { return sum(x + 1, y - 1); } else ...

  9. 转:git windows中文目录乱码问题解决

    Git的Windows版本Msysgit对中文的支持不够好 当使用时,会出现以下三种情况的中文乱码: 1.ls不能显示中文目录 解决办法:在git/git-completion.bash中增加一行:  ...

  10. Excel 公式集

    1.  Excel 公式集 按身份证计算年龄 按日计算的 (2018/12/20)(身份证 C2): =TRUNC((DAYS360(CONCATENATE(MID(C2,7,4),"/&q ...