FZU2151 :OOXX Game

时间限制:1000MS    内存限制:32768KByte   64位IO格式:%I64d & %I64u
描述

Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, there are N*M coins in this board with two symbol “O” or “X”. Then they take turns to choose a grid with symbol “O” and change it into “X”. The game ends when all the symbols in the board are “X”, and the one who cannot play in his (her) turns loses the game. Fat brother and Maze like this kind of OOXX game very much and play it day and night. They don’t even need a little rest after each game!

Here's the problem: Who will win the game if both use the best strategy? You can assume that Maze always goes first.

输入

The first line of the date is an integer T, which is the number of the text cases.

Then T cases follow, each case contains two integers N and M indicate the size of the board. Then goes N line, each line with M character shows the state of the board.

1 <= T <=100, 1 <= n <=100, 1 <= m <=100

输出

For each case, output the case number first, and then output the winner’s name, either Fat brother or Maze. See the sample input and output for more details.

样例输入
3
1 4
OXXX
2 4
OOXX
OOXX
1 2
XX
样例输出
Case 1: Maze
Case 2: Fat brother
Case 3: Fat brother
[提交] [状态]

|返回 |   | 转到页头|
Copyright @ 2008-2025 (浙ICP备2022001332号), TZOJ. All Rights Reserved.
2017-2025 台州市非普软件技术有限公司,浙江省台州市君悦大厦B幢1603室