CF1365A Matrix Game

题目描述

一个 $n$ 行 $m$ 列的网格图,有些格子上已经有 $1$,`Ashish` 和 `Vivek` 在这张网格图上做游戏,`Ashish` 先手。 对于当前玩家,他需要在网格图上找一个位置设置为 $1$,条件是这一个位置所在的行以及列上都没有其他的 $1$,如果他不能操作了,那么他就输了。 求对于输入的网格图,谁能获胜。

输入格式

**本题有多组数据** 第一行有一个正整数 $T$,表示有 $T$ 组数据。 每组数据的第一行有两个正整数 $n, m$,表示网格图的行数以及列数。 之后 $n$ 行,每行一个长度为 $m$ 的 01 串,描述了这组数据的网格图上的这一行的初始状态。 保证 $1\le t,n,m\le50$。

输出格式

对于每组数据,输出胜者的名字。

说明/提示

For the first case: One possible scenario could be: Ashish claims cell $ (1, 1) $ , Vivek then claims cell $ (2, 2) $ . Ashish can neither claim cell $ (1, 2) $ , nor cell $ (2, 1) $ as cells $ (1, 1) $ and $ (2, 2) $ are already claimed. Thus Ashish loses. It can be shown that no matter what Ashish plays in this case, Vivek will win. For the second case: Ashish claims cell $ (1, 1) $ , the only cell that can be claimed in the first move. After that Vivek has no moves left. For the third case: Ashish cannot make a move, so Vivek wins. For the fourth case: If Ashish claims cell $ (2, 3) $ , Vivek will have no moves left.