Sasha and Sticks CodeForces
来源:互联网 发布:java面试问题 编辑:程序博客网 时间:2024/05/01 10:03
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).
Example
Input
1 1
Output
YES
Input
10 4
Output
NO
Note
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.
大致题意:就是一共有n个木棒,每人每次都得拿k根,谁先不能拿谁输。
思路:水题,直接判断
代码如下
#include <iostream> #include <cmath>#include <algorithm>#include <cstring>#include <queue>#include <cstdio>using namespace std; #define ll long long int int main() { ll a,b; cin>>a>>b; int c=a/b; if(c%2==0) cout<<"NO"; else cout<<"YES"; return 0;}
- Sasha and Sticks CodeForces
- Codeforces Round #425 A. Sasha and Sticks
- Sasha and Sticks (Codeforces 832A)
- codeforces 832A Sasha and Sticks
- Codeforces832A Sasha and Sticks
- A. Sasha and Sticks
- Codeforces Round #425 (Div. 2)A. Sasha and Sticks
- Codeforces Round #425 (Div. 2) A.Sasha and Sticks
- codeforces 832A ——Sasha and Sticks
- Codeforces Round #425 (Div. 2) A. Sasha and Sticks
- Codeforces Round #425 (Div. 2) A. Sasha and Sticks
- cf round425A. Sasha and Sticks
- CodeForce 832A Sasha and Sticks
- Codeforces 718C C. Sasha and Array
- codeforces 718 C.Sasha and Array
- codeforces 718C - Sasha and Array
- [题解]codeforces 718c Sasha and Array
- Codeforces Round #373 (Div. 1) C.Sasha and Array
- [leetcode]668. Kth Smallest Number in Multiplication Table
- 源码安装tensorflow
- [知了堂学习笔记]_css3特效第二篇--行走的线条&&置顶导航栏
- Android去除字符串中空格制表符换行
- UI组件——WebView部分api释义
- Sasha and Sticks CodeForces
- 电池高压安全注意事项
- 迭代
- PHP进行3des加密
- 从服务器下载mp3文件,保存到MediaStore,提取数据mp3中的信息
- Java注解--四种元注解
- python之正则表达式教程(初级)
- 0828 Web知识初了解
- 内存管理--堆