2015山东省第六届acm省赛 C题Game!

Game!

Time Limit: 1000MS  Memory Limit: 65536KB
Submit  Statistic  Discuss

Problem Description

One day, zbybr is playing a game with blankcqk, here are the rules of the game:

There is a circle of N stones, zbybr and blankcqk take turns taking the stones.

Each time, one player can choose to take one stone or take two adjacent stones.

You should notice that if there are 4 stones, and zbybr takes the 2nd, the 1st and 3rd stones are still not adjacent.

The winner is the one who takes the last stone.

Now, the game begins and zbybr moves first.

 

If both of them will play with the best strategy, can you tell me who will win the game?

Input

The first line of input contains an integer T, indicating the number of test cases (T≈100000).

For each case, there is a positive integer N (N ≤ 10^18).

Output

Output the name of the winner.

Example Input

2
1
2

Example Output

zbybr
zbybr

Hint

Author

 “浪潮杯”山东省第六届ACM大学生程序设计竞赛
附题目链接 http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/3253.html

题目的意思是给出n个成环的石子,每次只能够拿一个或者相邻的两个,这道题目可以进一步转换,当先手拿走一个或者相邻的两个的时候,则当前n个石子的环就变成了n-1个或者n-2的链表,这个就可以很容易计算了。

#include 
using namespace std;

int main(){
	int n,t;
	scanf("%d",&t);
	while(t --){
		scanf("%d",&n);
		if(n == 1 || n == 2)
			printf("zbybr\n");
		else
			printf("blankcqk\n");
	}	
	return 0;
}



你可能感兴趣的:(博弈,博弈论)