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. eclipse 搜索 正则表达式

    1.换行搜索,如下: \.dyform\([\r]*[\s]*\{

  2. Tomcat------启动时报错:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].

    启动报错信息: Failed to start component [StandardEngine[Catalina].StandardHost[localhost] 因此出现这种错误的原因可能有: ...

  3. Linux+Redis实战教程_day03_4、通用redis命令【重点】

    4.通用redis命令[重点] Redis五种数据类型,String,hash,list,set,有序set l keys pattern:获取所有与pattern匹配的key,返回所有与该key匹配 ...

  4. 解决win10休眠后无法唤醒

    在控制面板-电源选项-编辑计划设置-高级电源设置中把"睡眠"的选项中休眠调整为从不,"电源按键和盖子"选项中也都设为睡眠,这样使得无论你是使用电池还是电源,系统 ...

  5. 关于MySQL数据库

    MySQL最流行的关系型数据库管理系统 MySQL官网:http://www.mysql.com MySQL是WEB应用方面最好的RDBMS应用软件之一 RDBMS:Relational Databa ...

  6. HTML 注释

    "<!-- xxx -->" 用于在 HTML 中插入注释,注释是用来给开发人员看的,浏览器不会显示注释内容 <!DOCTYPE HTML> <htm ...

  7. 关于linux下文件的权限问题

    今天在linux更新服务中的启动文件时,直接把更新的启动文件拷贝过来执行,报错:can't be execute 后来想了下列出了文件的详细信息中发现拷贝过去的执行文件是-r--r--r--(表示只有 ...

  8. 【Shell脚本编程系列】Shell脚本开发的习惯和规范

    1.开头指定脚本解释器 #!/bin/sh或#!/bin/bash 2.开头加版本版权信息 #Date #Author #Mail #Function #Version 提示:可配置vim编辑文件时自 ...

  9. Java 反编译工具 —— JAD 的下载地址(Windows版/Linux版/Mac OS 版)

    Java 反编译工具 —— JAD 的下载地址. 各种版本哦! Windows版,Linux版,Mac OS 版,等等 下载地址: http://varaneckas.com/jad/

  10. * 和-> 优先级

    (Apple *)pf->peel();      则报错说     ct.cpp: In function ‘int main()’:ct.cpp:48: 错误:void 值未如预期地被忽略 ...