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. flume 增量上传日志文件到HDFS中

    1.采集日志文件时一个很常见的现象 采集需求:比如业务系统使用log4j生成日志,日志内容不断增加,需要把追加到日志文件中的数据实时采集到hdfs中. 1.1.根据需求,首先定义一下3大要素: 采集源 ...

  2. MapWinGIS------引发类型为“System.Windows.Forms.AxHost+InvalidActiveXStateException”的异常

    转载:http://www.cnblogs.com/dzone/archive/2011/09/08/2171445.html

  3. Core Java笔记

    前言 一·基础知识 二·定义,关键字和类型 三·表达式和控制流 四·数组 五·对象和类 六·高级语言特性 七·异常 八·图形用户接口 九·AWT(Abstract Window Toolkit) 事件 ...

  4. 【NodeJS】热更新

    1.npm install -g supervisor 2.supervisor WellDetect.js

  5. 后端判断用户是否关闭浏览器(关闭网站相关的全部tab)

    一)程序步骤 1.js 写一个定时请求后端(php),后端接收到请求到,把当前时间戳写入文件 2.php 阻塞,这里我写的是 30 秒,也就是 sleep(30) 3.获取当前时间和文件里的时间作比较 ...

  6. Linux终端多用户通信实用命令

    一  命令 1.1 write 该命令将当前终端(源)输入的字符拷贝至目标用户的终端,从而发送消息给系统中某个用户.用法如下: #write <user> <msg> [Ctr ...

  7. GNU Readline库函数的应用示例

    说明 GNU Readline是一个跨平台开源程序库,提供交互式的文本编辑功能.应用程序借助该库函数,允许用户编辑键入的命令行,并提供自动补全和命令历史等功能.Bash(Bourne Again Sh ...

  8. 【消息队列】windows下安装RabbitMQ消息队列服务器

    RabbitMQ是什么 ? RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.他遵循Mozilla Public License开源协议. 1:安装RabbitMQ需要先安装Erla ...

  9. Win8应用开发 入门篇(三) UX交互导航模式

    导航模式(Windows 应用商店应用)   在本文中 分层模式 画布上导航 顶部应用栏 语义式缩放 相关主题 组织 Windows 应用商店应用中的内容,以便用户可以轻松而直观地进行导航.使用正确的 ...

  10. DELPHIER,正转向PYTHON了

    用了10多年的DELPHI ,现在准备学PYTHON了, 理由是: 1)现在是云计算时代了,需要学习一门适应该时代的语言,研究了很久,PYTHON是最佳选择,排除了PHP,PERL,RUBY等,至于G ...