#abc351b. B - Spot the Difference
B - Spot the Difference
Score: points
问题陈述
给定两个网格,每个网格都有 行和 列,分别称为网格 和网格 。 网格中的每个单元格都包含一个小写英文字母。 网格 中第 行第 列的字符是 。 网格 中第 行第 列的字符是 。
这两个网格在一个单元格上不同。也就是说,存在唯一的一对正整数 ,且这对整数不超过 ,使得 。找到这个 。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given two grids, each with rows and columns, referred to as grid and grid .
Each cell in the grids contains a lowercase English letter.
The character at the -th row and -th column of grid is .
The character at the -th row and -th column of grid is .
The two grids differ in exactly one cell. That is, there exists exactly one pair of positive integers not greater than such that . Find this .
Constraints
- and are all lowercase English letters.
- There exists exactly one pair such that .
Input
The input is given from Standard Input in the following format:
Output
Let be the pair of positive integers not greater than such that . Print in the following format:
Sample Input 1
3
abc
def
ghi
abc
bef
ghi
Sample Output 1
2 1
From d
and b
, we have , so satisfies the condition in the problem statement.
Sample Input 2
1
f
q
Sample Output 2
1 1
Sample Input 3
10
eixfumagit
vtophbepfe
pxbfgsqcug
ugpugtsxzq
bvfhxyehfk
uqyfwtmglr
jaitenfqiq
acwvufpfvv
jhaddglpva
aacxsyqvoj
eixfumagit
vtophbepfe
pxbfgsqcug
ugpugtsxzq
bvfhxyehok
uqyfwtmglr
jaitenfqiq
acwvufpfvv
jhaddglpva
aacxsyqvoj
Sample Output 3
5 9