KROW - K-In-A-Row

题意翻译

## 题目描述 小A和小B正在玩一种游戏,规则如下: 小A用棋子 “ x ” ,小B用棋子 “ o ” ,两人轮流下棋,直到有人连续排了 $k$ 个棋子为止。 简单地说,两人就是在 $n*m$ 的棋盘里下 $k$ 子棋。 注意:每局棋要么有且只有一人赢,要么两人平手。 现在,小A和小B拿出了他们下的 $t$ 张纸,要求你统计他们的胜负数量。 ## 输入格式 第一行一个数 $t$ ,如题所述。 对于每组数据: 首先是三个数 $n,m,k$ ,如题所述; 接下来 $n*m$ 的字符矩阵描述了棋盘( “ . ” 表示这里没有下棋 )。 ## 输出格式 输出小A和小B的比分,如样例输出所示。

题目描述

Hansel and Gretel do not listen to their teacher at school. Instead they secretly play a game called K-In-A-Row. One day in the evening they started to argue who had won more games that day. They collected all the papers they had used for playing the game and they started to count how many times each of them had won. But it was very tedious and they were sleepy. Help them to count how many games each of them had won. K-In-A-Row is played in a square grid with M times N squares. Two players alternate in their moves. A player chooses an empty square and fills in his/her sign (Hansel uses cross 'x' and Gretel uses circle 'o'). The game is won by the player who first places at least K his/her own signs in a row (either horizontally, vertically or in one of the two diagonal directions). The game stops immediately after one of the players completes K of his/her signs in a row; thus it may never happen that both players have completed K of their signs in a row. If no player creates such a row, nobody wins.

输入输出格式

输入格式


输出格式


输入输出样例

输入样例 #1

file:
2
3 3 3
.x.
.xo
oox
4 7 4
....
..x.
ooox
oxx.
oox.
o.ox
..xx

输出样例 #1

file: 
0:1