HOJ 1846 Brave Game(巴什游戏,水题)

/*
巴什游戏,水题
本题要点:
1、如果当前剩下的石头 n 是 m + 1 的倍数,甲必输。
*/

#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int T, n, m;

int main()
{
	scanf("%d", &T);
	while(T--)
	{
		scanf("%d%d", &n, &m);
		if(n % (m + 1) == 0)
			printf("second\n");
		else	
			printf("first\n");
	}
	return 0;
}

/*
2
23 2
4 3
*/

/*
first
second
*/

猜你喜欢

转载自blog.csdn.net/qq_38232157/article/details/108456423
今日推荐