#abc305c. C - Snuke the Cookie Picker
C - Snuke the Cookie Picker
Score : points
问题描述
存在一个 行和 列的网格。令 表示从上数第 行、从左数第 列的方格。
起初,在一个高度和宽度至少为2个方格长的矩形内每个方格上都有一块饼干,而其它方格上没有饼干。
形式上,恰好存在一组整数四元组 满足以下所有条件:
- 对于满足 的每个方格 上都有一个饼干,而在其它方格上则没有饼干。
然而,Snuke 吃掉并拿走了一块网格上的饼干。
现在作为输入,你得到的是 Snuke 吃掉饼干后网格的状态。方格 的状态用字符 表示,其中 #
表示有饼干的方格,.
表示没有饼干的方格。
请找出被 Snuke 吃掉饼干的那个方格。(答案是唯一确定的。)
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There is a grid with rows and columns. Let denote the square at the -th row from the top and the -th column from the left.
Initially, there was one cookie on each square inside a rectangle whose height and width were at least squares long, and no cookie on the other squares.
Formally, there was exactly one quadruple of integers that satisfied all of the following conditions.
- There was one cookie on each square such that , and no cookie on the other squares.
However, Snuke took and ate one of the cookies on the grid.
The square that contained that cookie is now empty.
As the input, you are given the state of the grid after Snuke ate the cookie.
The state of the square is given as the character , where #
means a square with a cookie, and .
means a square without one.
Find the square that contained the cookie eaten by Snuke. (The answer is uniquely determined.)
Constraints
- is
#
or.
.
Input
The input is given from Standard Input in the following format:
Output
Let the square contained the cookie eaten by Snuke. Print and in this order, separated by a space.
Sample Input 1
5 6
......
..#.#.
..###.
..###.
......
Sample Output 1
2 4
Initially, cookies were on the squares inside the rectangle with as the top-left corner and as the bottom-right corner, and Snuke ate the cookie on . Thus, you should print .
Sample Input 2
3 2
#.
##
##
Sample Output 2
1 2
Initially, cookies were placed on the squares inside the rectangle with as the top-left corner and as the bottom-right corner, and Snuke ate the cookie at .
Sample Input 3
6 6
..####
..##.#
..####
..####
..####
......
Sample Output 3
2 5
update @ 2024/3/10 08:36:13