比赛 20161115 评测结果 AAAAAAAAAA
题目名称 取石块儿 最终得分 100
用户昵称 iortheir 运行时间 1.193 s
代码语言 C++ 内存使用 0.25 MiB
提交时间 2016-11-15 09:21:36
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>

using namespace std;

typedef unsigned long long Uint;

int t;

Uint n;
Uint k;

inline Uint read()
{
    Uint x = 0,f = 1;char ch = getchar();
    while(ch < '0'||ch > '9'){if(ch == '-')f = -1;ch = getchar();}
    while(ch >= '0'&&ch <= '9'){x = x * 10 + ch - '0';ch = getchar();}
    return x * f;
}

//小L先手 求小T是否赢 

int main()
{
	freopen("tstones.in","r",stdin);
	freopen("tstones.out","w",stdout);
	scanf("%d",&t);
	for(int i = 1;i <= t ;i ++)
	{
		n = read();
		k = read();
		if(n % (k + 1) == 0)
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}