2708String Game

2708   String Game

题目描述

Alice and Bob are playing the following game with strings of letters.

Before the game begins, an initial string and a target string are decided. The initial string is at least as long as the target string. Then, Alice and Bob take turns, starting with the initial string. Bob goes first. In each turn, the current player removes either the first or the last letter of the current string. Once the length of the current string becomes equal to the length of the target string, the game stops. If the string at the end of the game is equal to the target string, Alice wins the game; otherwise Bob wins.

Determine who will win the game if both players are playing optimally.

输入格式:

Each test case starts with N, the number of inputs to process. Each input consists of one line, which contains the initial string, followed by a space, followed by the target string. Each string consists of only lowercase letters. The total input length will be less than 500000 characters.

输出格式:

For each input, output the winner, which will either be Alice or Bob.

输入样例 复制
5
aba b
bab b
aaab aab
xyz mnk
xyz xyz
输出样例 复制
Alice
Alice
Bob
Bob
Alice

说明

3
23
通过提交
时空限制1000ms/128mb
题目来源
评测方式在线评测
题目类型
难        度