[NOI2011]兔兔与蛋蛋游戏

Grade Open Time Friday, 19 September 2014, 10:07 am
Discount 0.8 Time Discount Friday, 26 September 2014, 10:07 am
Allow late Yes Close Time Friday, 26 September 2014, 10:07 am
Input file noi2011_game.in Output file noi2011_game.out

样例见下:

【输入样例1】

1 6

XO.OXO

1

1 2

1 1


【输入样例2】

3 3

XOX

O.O

XOX

4

2 3

1 3

1 2

1 1

2 1

3 1

3 2

3 3


【输入样例3】

4 4

OOXX

OXXO

OO.O

XXXO

2

3 2

2 2

1 2

1 3