#P10507. Georgia and Bob

Georgia and Bob

题目描述

Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1,2,3,,1 , 2 , 3 , \cdots , and place NN chessmen on different grids, as shown in the following figure for example:

Georgia and Bob move the chessmen in turn. Every time a player will choose a chessman, and move it to the left without going over any other chessmen or across the left edge. The player can freely choose number of steps the chessman moves, with the constraint that the chessman must be moved at least ONE step and one grid can at most contains ONE single chessman. The player who cannot make a move loses the game.

Georgia always plays first since "Lady first". Suppose that Georgia and Bob both do their best in the game, i.e., if one of them knows a way to win the game, he or she will be able to carry it out.

Given the initial positions of the nn chessmen, can you predict who will finally win the game?

输入格式

The first line of the input contains a single integer T(1T20)T (1 \leq T \leq 20), the number of test cases. Then TT cases follow. Each test case contains two lines. The first line consists of one integer N(1N1000)N (1 \leq N \leq 1000), indicating the number of chessmen. The second line contains NN different integers P1,P2Pn(1Pi10000)P_1, P_2 \dots P_n (1 \leq P_i \leq 10000), which are the initial positions of the nn chessmen.

输出格式

For each test case, prints a single line, "Georgia will win", if Georgia will win the game; "Bob will win", if Bob will win the game; otherwise 'Not sure'.

题目大意

【题目描述】

有一个无限长的棋盘,从左到右编号为 1,2,3,1,2,3,\cdots。有 nn 个棋子在棋盘上,定义一次操作为把一枚棋子向左移动至少一格,不可以逾越其他棋子,不可与其他棋子重合,不可移出棋盘。

告诉你这 nn 个棋子的位置(不保证顺序且保证没有棋子重合),Georgia 和 Bob 轮流进行操作,Georgia 先手,谁无法操作谁输。问最后谁会赢?

【输入格式】

本题有多组数据

第一行一个整数 TT,表示数据组数。

对于每组数据:

第一行一个整数 nn

接下来一行 nn 个整数,表示每个棋子的位置。

【输出格式】

对于每组数据,若 Georgia 胜输出 Georgia will win,若 Bob 胜输出 Bob will win,若平局则输出 Not sure

2
3
1 2 3
8
1 5 6 7 9 12 14 17
Bob will win
Georgia will win